All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Torok <alext9@gmail.com>
To: git@vger.kernel.org
Cc: Alex Torok <alext9@gmail.com>
Subject: [PATCH v2 2/2] rebase: find --fork-point with full ref
Date: Thu,  5 Dec 2019 18:57:04 -0500	[thread overview]
Message-ID: <20191205235704.31385-3-alext9@gmail.com> (raw)
In-Reply-To: <20191205235704.31385-1-alext9@gmail.com>

rebase --fork-point needs to look up the full ref name before calling
get_fork_point in the same manner that merge-base --fork-point does.

Signed-off-by: Alex Torok <alext9@gmail.com>
---
 builtin/rebase.c             | 4 +++-
 t/t3431-rebase-fork-point.sh | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/builtin/rebase.c b/builtin/rebase.c
index e755087b0f..821994f676 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1980,8 +1980,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		struct commit *head =
 			lookup_commit_reference(the_repository,
 						&options.orig_head);
+		char * full_name;
+		dwim_ref_or_die(options.upstream_name, strlen(options.upstream_name), &full_name);
 		options.restrict_revision =
-			get_fork_point(options.upstream_name, head);
+			get_fork_point(full_name, head);
 	}
 
 	if (repo_read_index(the_repository) < 0)
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 78851b9a2a..6ecdae918e 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -49,6 +49,7 @@ test_rebase 'G F C D B A' --no-fork-point --onto D
 test_rebase 'G F C B A' --no-fork-point --keep-base
 test_rebase 'G F E D B A' --fork-point refs/heads/master
 test_rebase 'G F D B A' --fork-point --onto D refs/heads/master
+test_rebase 'G F D B A' --fork-point --onto D master
 test_rebase 'G F B A' --fork-point --keep-base refs/heads/master
 test_rebase 'G F C E D B A' refs/heads/master
 test_rebase 'G F C D B A' --onto D refs/heads/master
-- 
2.17.1


  parent reply	other threads:[~2019-12-05 23:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 22:53 [PATCH 0/3] rebase: fix bug in --fork-point Alex Torok
2019-12-05 22:53 ` [PATCH 1/3] rebase: add test for rebase --fork-point with short upstream Alex Torok
2019-12-05 23:04   ` Junio C Hamano
2019-12-05 23:25     ` Alex Torok
2019-12-05 22:53 ` [PATCH 2/3] rebase: refactor dwim_ref_or_die from merge-base.c Alex Torok
2019-12-05 22:53 ` [PATCH 3/3] rebase: fix rebase to use full ref to find fork-point Alex Torok
2019-12-05 23:57 ` [PATCH v2 0/2] rebase: fix bug in --fork-point Alex Torok
2019-12-05 23:57   ` [PATCH v2 1/2] rebase: refactor dwim_ref_or_die from merge-base.c Alex Torok
2019-12-06  1:23     ` Denton Liu
2019-12-06 13:13       ` Alex Torok
2019-12-05 23:57   ` Alex Torok [this message]
2019-12-06  1:48     ` [PATCH v2 2/2] rebase: find --fork-point with full ref Denton Liu
2019-12-06 10:52       ` Phillip Wood
2019-12-06 13:46         ` Alex Torok
2019-12-06 19:11           ` [PATCH v2 2/2] rebase: find --fork-point with full refgg Denton Liu
2019-12-06 19:35             ` Phillip Wood
2019-12-09 14:53   ` [PATCH v3 0/1] rebase: fix --fork-point with short ref upstream Alex Torok
2019-12-09 14:53     ` [PATCH v3 1/1] rebase: fix --fork-point with short refname Alex Torok
2019-12-09 18:51       ` Junio C Hamano
2019-12-11  1:21         ` Alex Torok
2019-12-11 12:21         ` Denton Liu
2019-12-11 16:02           ` Eric Sunshine
2020-02-11 18:15             ` [PATCH v4 1/1] rebase: --fork-point regression fix Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205235704.31385-3-alext9@gmail.com \
    --to=alext9@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.