3 # Copyright (c) 2007 Junio C Hamano
6 test_description
='Quoting paths in diff output.
16 echo 2>/dev
/null
>"$P1" && test -f "$P1" && rm -f "$P1" ||
{
17 skip_all
='Your filesystem does not allow tabs in filenames'
21 test_expect_success setup
'
30 git commit -m initial &&
31 git mv "$P0.0" "R$P0.0" &&
32 git mv "$P0.1" "R$P1.0" &&
33 git mv "$P0.2" "R$P2.0" &&
34 git mv "$P0.3" "R$P3.0" &&
35 git mv "$P1.0" "R$P0.1" &&
36 git mv "$P1.2" "R$P2.1" &&
37 git mv "$P1.3" "R$P3.1" &&
41 test_expect_success
'setup expected files' '
43 rename pathname.1 => "Rpathname\twith HT.0" (100%)
44 rename pathname.3 => "Rpathname\nwith LF.0" (100%)
45 rename "pathname\twith HT.3" => "Rpathname\nwith LF.1" (100%)
46 rename pathname.2 => Rpathname with SP.0 (100%)
47 rename "pathname\twith HT.2" => Rpathname with SP.1 (100%)
48 rename pathname.0 => Rpathname.0 (100%)
49 rename "pathname\twith HT.0" => Rpathname.1 (100%)
53 test_expect_success
'git diff --summary -M HEAD' '
54 git diff --summary -M HEAD >actual &&
55 test_cmp expect actual
58 test_expect_success
'git diff --numstat -M HEAD' '
59 cat >expect <<-\EOF &&
60 0 0 pathname.1 => "Rpathname\twith HT.0"
61 0 0 pathname.3 => "Rpathname\nwith LF.0"
62 0 0 "pathname\twith HT.3" => "Rpathname\nwith LF.1"
63 0 0 pathname.2 => Rpathname with SP.0
64 0 0 "pathname\twith HT.2" => Rpathname with SP.1
65 0 0 pathname.0 => Rpathname.0
66 0 0 "pathname\twith HT.0" => Rpathname.1
68 git diff --numstat -M HEAD >actual &&
69 test_cmp expect actual
72 test_expect_success
'git diff --stat -M HEAD' '
73 cat >expect <<-\EOF &&
74 pathname.1 => "Rpathname\twith HT.0" | 0
75 pathname.3 => "Rpathname\nwith LF.0" | 0
76 "pathname\twith HT.3" => "Rpathname\nwith LF.1" | 0
77 pathname.2 => Rpathname with SP.0 | 0
78 "pathname\twith HT.2" => Rpathname with SP.1 | 0
79 pathname.0 => Rpathname.0 | 0
80 "pathname\twith HT.0" => Rpathname.1 | 0
81 7 files changed, 0 insertions(+), 0 deletions(-)
83 git diff --stat -M HEAD >actual &&
84 test_i18ncmp expect actual