summaryrefslogtreecommitdiff
path: root/builtin/merge-base.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-26 17:11:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-26 17:11:21 -0700
commitfb4175b0e4bec59b97dae84a0073d8a5334508d6 (patch)
tree737f3835be75b15214fa58b42594f912d36c9c66 /builtin/merge-base.c
parentMerge branch 'bc/filter-process' (diff)
parentrebase: --fork-point regression fix (diff)
downloadtgif-fb4175b0e4bec59b97dae84a0073d8a5334508d6.tar.xz
Merge branch 'at/rebase-fork-point-regression-fix'
The "--fork-point" mode of "git rebase" regressed when the command was rewritten in C back in 2.20 era, which has been corrected. * at/rebase-fork-point-regression-fix: rebase: --fork-point regression fix
Diffstat (limited to 'builtin/merge-base.c')
-rw-r--r--builtin/merge-base.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index e3f8da13b6..6719ac198d 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -114,26 +114,16 @@ static int handle_is_ancestor(int argc, const char **argv)
static int handle_fork_point(int argc, const char **argv)
{
struct object_id oid;
- char *refname;
struct commit *derived, *fork_point;
const char *commitname;
- switch (dwim_ref(argv[0], strlen(argv[0]), &oid, &refname)) {
- case 0:
- die("No such ref: '%s'", argv[0]);
- case 1:
- break; /* good */
- default:
- die("Ambiguous refname: '%s'", argv[0]);
- }
-
commitname = (argc == 2) ? argv[1] : "HEAD";
if (get_oid(commitname, &oid))
die("Not a valid object name: '%s'", commitname);
derived = lookup_commit_reference(the_repository, &oid);
- fork_point = get_fork_point(refname, derived);
+ fork_point = get_fork_point(argv[0], derived);
if (!fork_point)
return 1;