Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: --remerge-diff needs to keep around commit parents #1825

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,14 @@ static int cmd_log_walk_no_free(struct rev_info *rev)
* but we didn't actually show the commit.
*/
rev->max_count++;
if (!rev->reflog_info) {
if (!rev->reflog_info && !rev->remerge_diff) {
/*
* We may show a given commit multiple times when
* walking the reflogs.
* walking the reflogs. Therefore we still need it.
*
* Likewise, we potentially still need the parents
* of * already shown commits to determine merge
* bases when showing remerge diffs.
*/
free_commit_buffer(the_repository->parsed_objects,
commit);
Expand Down
7 changes: 7 additions & 0 deletions t/t4069-remerge-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,11 @@ test_expect_success 'remerge-diff turns off history simplification' '
test_cmp expect actual
'

test_expect_success 'remerge-diff with --reverse' '
git log -1 --remerge-diff --oneline ab_resolution^ >expect &&
git log -1 --remerge-diff --oneline ab_resolution >>expect &&
git log -2 --remerge-diff --oneline ab_resolution --reverse >actual &&
test_cmp expect actual
'

test_done
Loading