diff --git a/builtin/log.c b/builtin/log.c index c0a8bb95e9830b..a297c6caf59b01 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -522,7 +522,7 @@ 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. diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh index 07323ebafe0d0c..d71564d29c65e3 100755 --- a/t/t4069-remerge-diff.sh +++ b/t/t4069-remerge-diff.sh @@ -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 4d00047^ >expect && + git log -1 --remerge-diff --oneline 4d00047 >>expect && + git log -2 --remerge-diff --oneline 4d00047 --reverse >actual && + test_cmp expect actual +' + test_done