3 # Copyright (c) 2006 Junio C Hamano
6 test_description='quoted output'
19 Name "Name and a${LF}LF" "Name and an${HT}HT" "Name${DQ}" \
20 "$FN$HT$GN" "$FN$LF$GN" "$FN $GN" "$FN$GN" "$FN$DQ$GN" \
27 test_expect_success setup '
29 for_each_name "echo initial >\"\$name\""
31 git commit -q -m Initial &&
33 for_each_name "echo second >\"\$name\"" &&
34 git commit -a -m Second
36 for_each_name "echo modified >\"\$name\""
40 cat >expect.quoted <<\EOF
46 "\346\277\261\351\207\216\t\347\264\224"
47 "\346\277\261\351\207\216\n\347\264\224"
48 "\346\277\261\351\207\216 \347\264\224"
49 "\346\277\261\351\207\216\"\347\264\224"
50 "\346\277\261\351\207\216\347\264\224"
53 cat >expect.raw <<\EOF
66 test_expect_success 'check fully quoted output from ls-files' '
68 git ls-files >current && diff -u expect.quoted current
72 test_expect_success 'check fully quoted output from diff-files' '
74 git diff --name-only >current &&
75 diff -u expect.quoted current
79 test_expect_success 'check fully quoted output from diff-index' '
81 git diff --name-only HEAD >current &&
82 diff -u expect.quoted current
86 test_expect_success 'check fully quoted output from diff-tree' '
88 git diff --name-only HEAD^ HEAD >current &&
89 diff -u expect.quoted current
93 test_expect_success 'setting core.quotepath' '
95 git config --bool core.quotepath false
99 test_expect_success 'check fully quoted output from ls-files' '
101 git ls-files >current && diff -u expect.raw current
105 test_expect_success 'check fully quoted output from diff-files' '
107 git diff --name-only >current &&
108 diff -u expect.raw current
112 test_expect_success 'check fully quoted output from diff-index' '
114 git diff --name-only HEAD >current &&
115 diff -u expect.raw current
119 test_expect_success 'check fully quoted output from diff-tree' '
121 git diff --name-only HEAD^ HEAD >current &&
122 diff -u expect.raw current