]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff: fix modified lines stats with --stat and --numstat
authorThomas Guyot-Sionnest <tguyot@gmail.com>
Thu, 24 Sep 2020 07:41:41 +0000 (03:41 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Sep 2020 19:31:45 +0000 (12:31 -0700)
commitff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9
tree13b458b7986c3cfafa1984b0bb8d1f45f691c904
parente1cfff676549cdcd702cbac105468723ef2722f4
diff: fix modified lines stats with --stat and --numstat

Only skip diffstats when both oids are valid and identical. This check
was causing both false-positives (files included in diffstats with no
actual changes (0 lines modified) and false-negatives (showing 0 lines
modified in stats when files had actually changed).

Also replaced same_contents with may_differ to avoid confusion.

Signed-off-by: Thomas Guyot-Sionnest <tguyot@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
t/t3206-range-diff.sh