summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:17 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:17 -0700
commit96ec83ce5207be0aac3c1df1ac92356f9de9ad81 (patch)
tree2fd2924a0023333772153f04fe654fbd8641e5b3 /builtin
parentMerge branch 'dk/worktree-dup-checkout-with-bare-is-ok' into maint (diff)
parentmerge-base: handle --fork-point without reflog (diff)
downloadtgif-96ec83ce5207be0aac3c1df1ac92356f9de9ad81.tar.xz
Merge branch 'jk/merge-base-fork-point-without-reflog' into maint
"git rebase" immediately after "git clone" failed to find the fork point from the upstream. * jk/merge-base-fork-point-without-reflog: merge-base: handle --fork-point without reflog
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge-base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index c0d1822eb3..b572a37c26 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -173,6 +173,9 @@ static int handle_fork_point(int argc, const char **argv)
revs.initial = 1;
for_each_reflog_ent(refname, collect_one_reflog_ent, &revs);
+ if (!revs.nr && !get_sha1(refname, sha1))
+ add_one_commit(sha1, &revs);
+
for (i = 0; i < revs.nr; i++)
revs.commit[i]->object.flags &= ~TMP_MARK;