diff options
author | Thomas Guyot-Sionnest <tguyot@gmail.com> | 2020-09-24 09:41:41 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-24 21:31:45 +0200 |
commit | ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9 (patch) | |
tree | 13b458b7986c3cfafa1984b0bb8d1f45f691c904 /t/t3206-range-diff.sh | |
parent | Sixteenth batch (diff) | |
download | git-ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9.tar.xz git-ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9.zip |
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>
Diffstat (limited to '')
-rwxr-xr-x | t/t3206-range-diff.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index e024cff65c..6eb344be03 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -252,17 +252,13 @@ test_expect_success 'changed commit with --stat diff option' ' git range-diff --no-color --stat topic...changed >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid c1) s/5/A/ - a => b | 0 - 1 file changed, 0 insertions(+), 0 deletions(-) 2: $(test_oid t2) = 2: $(test_oid c2) s/4/A/ - a => b | 0 - 1 file changed, 0 insertions(+), 0 deletions(-) 3: $(test_oid t3) ! 3: $(test_oid c3) s/11/B/ - a => b | 0 - 1 file changed, 0 insertions(+), 0 deletions(-) + a => b | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) 4: $(test_oid t4) ! 4: $(test_oid c4) s/12/B/ - a => b | 0 - 1 file changed, 0 insertions(+), 0 deletions(-) + a => b | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) EOF test_cmp expect actual ' |