summaryrefslogtreecommitdiff
path: root/builtin/merge-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/merge-base.c')
-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;