summaryrefslogtreecommitdiff
path: root/builtin/annotate.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2024-09-21 17:09:54 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-23 09:41:07 -0700
commit9a41735af66dba1b677a8e88e7c2bc2f831bf6d2 (patch)
tree7a460477d6a7671574fd2af7cbcff032f6703bea /builtin/annotate.c
parent11591850ddd5e65d3d0aab22c0a7131b1eb1d6f0 (diff)
diff: report modified binary files as changes in builtin_diff()
The diff machinery has two ways to detect changes to set the exit code: Just comparing hashes and comparing blob contents. The latter is needed if certain changes have to be ignored, e.g. with --ignore-space-change or --ignore-matching-lines. It's enabled by the diff_options flag diff_from_contents. The code for handling binary files added by 1aaf69e669 (diff: shortcut for diff'ing two binary SHA-1 objects, 2014-08-16) always uses a quick hash-only comparison, even if the slow way is taken. We need it to report a hash difference as a change for the purpose of setting the exit code, though, but it never did. Fix that. d7b97b7185 (diff: let external diffs report that changes are uninteresting, 2024-06-09) set diff_from_contents if external diff programs are allowed. This is the default e.g. for git diff, and so that change exposed the inconsistency much more widely. Reported-by: Kohei Shibata <shiba200712@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/annotate.c')
0 files changed, 0 insertions, 0 deletions