summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <tguyot@gmail.com>2020-09-24 07:41:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-24 19:31:45 (GMT)
commitff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9 (patch)
tree13b458b7986c3cfafa1984b0bb8d1f45f691c904 /t
parente1cfff676549cdcd702cbac105468723ef2722f4 (diff)
downloadgit-ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9.zip
git-ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9.tar.gz
git-ff0c7fa8cbd7f7d5e81c2501222b60f0aac30bb9.tar.bz2
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 't')
-rwxr-xr-xt/t3206-range-diff.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index e024cff..6eb344b 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
'