Skip to content

Commit 9ce7028

Browse files
author
Junio C Hamano
committed
git-show-branch: tighten merge-base computation.
This makes the merge-base computation resistant to the pathological case discussed on the list earlier, by doing the same logic as git-merge-base. As a side effect, it breaks the command's primary function to list non-merge commit sequences, which needs to be fixed separately. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 592ee97 commit 9ce7028

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

show-branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ static void join_revs(struct commit_list **list_p,
181181

182182
while (*list_p) {
183183
struct commit_list *parents;
184+
int still_interesting = !!interesting(*list_p);
184185
struct commit *commit = pop_one_commit(list_p);
185186
int flags = commit->object.flags & all_mask;
186-
int still_interesting = !!interesting(*list_p);
187187

188-
if (!still_interesting && extra < 0)
188+
if (!still_interesting && extra <= 0)
189189
break;
190190

191191
mark_seen(commit, seen_p);

0 commit comments

Comments
 (0)