summaryrefslogtreecommitdiff
path: root/Documentation/technical/commit-graph.adoc
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2025-10-24 13:07:53 -0400
committerJunio C Hamano <gitster@pobox.com>2025-10-24 10:15:21 -0700
commit0152831d96af40277b0b69ef39e9c31b623dc753 (patch)
tree5f985764734f0c5fcc25278d4d5eb75fc9b8ec3c /Documentation/technical/commit-graph.adoc
parent57c2b6cc86edd29fa2d30bc53b4a476e0621619c (diff)
diff: drop save/restore of color_moved in dry-run mode
When running a dry-run content-level diff to check whether a "--quiet" diff has any changes, we have always unset the color_moved variable since the feature was added in 2e2d5ac184 (diff.c: color moved lines differently, 2017-06-30). The reasoning is not given explicitly there, but presumably the idea is that since color_moved requires a lot of extra computation to match lines but does not actually affect the found_changes flag, we want to skip it. Later, in 3da4413dbc (diff: make sure the other caller of diff_flush_patch_quietly() is silent, 2025-10-22) we copied the same idea for other dry-run diffs. But neither spot actually needs to reset this flag at all, because diff_flush_patch() will not ever compute color_moved. Nor could it, as it is only looking at a single file-pair, and we detect moves across files. So color_moved is checked only when we are actually doing real DIFF_FORMAT_PATCH output, and call diff_flush_patch_all_file_pairs(). So we can get rid of these extra lines to save and restore the color_moved flag without changing the behavior at all. (Note that there is no "restore" to drop for the second caller, as we know at that point we are not generating any output and can just leave the feature disabled). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical/commit-graph.adoc')
0 files changed, 0 insertions, 0 deletions