@matheusbsbs / matheus-bagliano / commits / 2ef108013e
Fork 0

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>

Junio C Hamano committed Jul 3, 2006 at 03:02 UTC 2ef108013ec15e8d5feee6d5c42692ae956ee302
1 file changed +2 -1
commit.c
+2 -1
@@ -1058,7 +1058,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1058 }
1059
1060 if (!result)
1061 - return NULL;
1061 + goto finish;
1062
1063 if (result->next && list)
1064 mark_reachable_commits(result, list);
@@ -1081,6 +1081,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
1081 tmp = next;
1082 }
1083
1084 + finish:
1085 if (cleanup) {
1086 clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
1087 clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);