summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-03 10:02:27 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-03 10:02:27 (GMT)
commit2ef108013ec15e8d5feee6d5c42692ae956ee302 (patch)
treea265f83e79f1483d3687dc02a29b998e95bdfc49 /commit.c
parent542ccefe896a8960a6ce0b0ba4519537649ae29a (diff)
downloadgit-2ef108013ec15e8d5feee6d5c42692ae956ee302.zip
git-2ef108013ec15e8d5feee6d5c42692ae956ee302.tar.gz
git-2ef108013ec15e8d5feee6d5c42692ae956ee302.tar.bz2
get_merge_bases: clean up even when there is no common commit.
Actually in this case we would have traversed a lot of commits, so cleaning things up is even more important. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index a608faf..12882fd 100644
--- a/commit.c
+++ b/commit.c
@@ -1058,7 +1058,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
}
if (!result)
- return NULL;
+ goto finish;
if (result->next && list)
mark_reachable_commits(result, list);
@@ -1081,6 +1081,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
tmp = next;
}
+ finish:
if (cleanup) {
clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);