summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc5877a)
raw | patch | inline | side by side (parent: fc5877a)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Tue, 13 Mar 2012 04:58:59 +0000 (23:58 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 13 Mar 2012 21:26:31 +0000 (14:26 -0700) |
This test script checks that git's plumbing commands quote filenames
with special characters like space, tab, and double-quote
appropriately in their input and output.
Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled). So:
- Tweak the three "git apply --stat" tests that check "git apply"'s
input parsing to use --numstat instead.
--numstat output is more reliable, does not vary with locale, and
is itself easier to parse. These tests are mainly about how "git
apply" parses its input so this should not result in much loss of
coverage.
- Add a new "apply --stat" test to check the quoting in --stat output
format.
This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
with special characters like space, tab, and double-quote
appropriately in their input and output.
Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled). So:
- Tweak the three "git apply --stat" tests that check "git apply"'s
input parsing to use --numstat instead.
--numstat output is more reliable, does not vary with locale, and
is itself easier to parse. These tests are mainly about how "git
apply" parses its input so this should not result in much loss of
coverage.
- Add a new "apply --stat" test to check the quoting in --stat output
format.
This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3300-funny-names.sh | patch | blob | history |
diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh
index 644aa219e9b3d030d8c6789d1c4edbcd2307b941..9114893b13017181d5f5fe5d9305b3c15f1a0e29 100755 (executable)
--- a/t/t3300-funny-names.sh
+++ b/t/t3300-funny-names.sh
EOF
'
-test_expect_success TABS_IN_FILENAMES 'git diff-tree rename with-funny applied' \
+test_expect_success TABS_IN_FILENAMES 'diffstat for rename with funny chars' \
'git diff-index -M -p $t0 |
git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
test_i18ncmp expected current'
+test_expect_success TABS_IN_FILENAMES 'numstat for rename with funny chars' \
+ 'cat >expected <<-\EOF &&
+ 0 0 "tabs\t,\" (dq) and spaces"
+ EOF
+ git diff-index -M -p $t0 >diff &&
+ git apply --numstat <diff >current &&
+ test_cmp expected current'
+
test_expect_success TABS_IN_FILENAMES 'setup expect' '
cat > expected <<\EOF
- no-funny
- "tabs\t,\" (dq) and spaces"
- 2 files changed, 3 insertions(+), 3 deletions(-)
+0 3 no-funny
+3 0 "tabs\t,\" (dq) and spaces"
EOF
'
-test_expect_success TABS_IN_FILENAMES 'git diff-tree delete with-funny applied' \
+test_expect_success TABS_IN_FILENAMES 'numstat without -M for funny rename' \
'git diff-index -p $t0 |
- git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
- test_i18ncmp expected current'
+ git apply --numstat >current &&
+ test_cmp expected current'
-test_expect_success TABS_IN_FILENAMES 'git apply non-git diff' \
+test_expect_success TABS_IN_FILENAMES 'numstat for non-git funny rename diff' \
'git diff-index -p $t0 |
sed -ne "/^[-+@]/p" |
- git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
- test_i18ncmp expected current'
+ git apply --numstat >current &&
+ test_cmp expected current'
test_done