Skip to content

Commit 0a15bb6

Browse files
szedergitster
authored andcommitted
line-log: simplify condition checking for merge commits
In process_ranges_arbitrary_commit() the condition deciding whether the given commit is not a merge, i.e. that it doesn't have more than one parent, is head-scratchingly backwards, flip it. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 62e4ef8 commit 0a15bb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

line-log.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,10 +1273,10 @@ int line_log_process_ranges_arbitrary_commit(struct rev_info *rev, struct commit
12731273
struct line_log_data *prange = line_log_data_copy(range);
12741274
add_line_range(rev, commit->parents->item, prange);
12751275
clear_commit_line_range(rev, commit);
1276-
} else if (!commit->parents || !commit->parents->next)
1277-
changed = process_ranges_ordinary_commit(rev, commit, range);
1278-
else
1276+
} else if (commit->parents && commit->parents->next)
12791277
changed = process_ranges_merge_commit(rev, commit, range);
1278+
else
1279+
changed = process_ranges_ordinary_commit(rev, commit, range);
12801280
}
12811281

12821282
if (!changed)

0 commit comments

Comments
 (0)