Skip to content

Commit

Permalink
get_merge_bases: clean up even when there is no common commit.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 3, 2006
1 parent 542ccef commit 2ef1080
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 2ef1080

Please sign in to comment.