diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2025-08-24 21:06:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-08-25 08:30:27 -0700 |
commit | 0a15bb634cf005a0266ee1108ac31aa75649a61c (patch) | |
tree | 28c6f1003f8d36b90d490a0ee58fb3c8cca91175 /line-log.c | |
parent | 62e4ef85fbc5574fd80caababbf41bd33f53a46d (diff) |
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>
Diffstat (limited to 'line-log.c')
-rw-r--r-- | line-log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/line-log.c b/line-log.c index 71fa857ee8..188d387d40 100644 --- a/line-log.c +++ b/line-log.c @@ -1273,10 +1273,10 @@ int line_log_process_ranges_arbitrary_commit(struct rev_info *rev, struct commit struct line_log_data *prange = line_log_data_copy(range); add_line_range(rev, commit->parents->item, prange); clear_commit_line_range(rev, commit); - } else if (!commit->parents || !commit->parents->next) - changed = process_ranges_ordinary_commit(rev, commit, range); - else + } else if (commit->parents && commit->parents->next) changed = process_ranges_merge_commit(rev, commit, range); + else + changed = process_ranges_ordinary_commit(rev, commit, range); } if (!changed) |