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>
This commit is contained in:
parent
542ccefe89
commit
2ef108013e
3
commit.c
3
commit.c
@ -1058,7 +1058,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
return NULL;
|
goto finish;
|
||||||
|
|
||||||
if (result->next && list)
|
if (result->next && list)
|
||||||
mark_reachable_commits(result, list);
|
mark_reachable_commits(result, list);
|
||||||
@ -1081,6 +1081,7 @@ struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2,
|
|||||||
tmp = next;
|
tmp = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
if (cleanup) {
|
if (cleanup) {
|
||||||
clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
|
clear_commit_marks(rev1, PARENT1 | PARENT2 | STALE);
|
||||||
clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
|
clear_commit_marks(rev2, PARENT1 | PARENT2 | STALE);
|
||||||
|
Loading…
Reference in New Issue
Block a user