summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:40 (GMT)
commitf008cef4abb2a4db766b4a152b304aca91a0101a (patch)
tree67c1722488c99d9f56aedcc8ae52fad3558e413e /t
parent52df9173fa9b409a96c02a62b06d2b19f4ff5d0f (diff)
parent14d3bb4955a41e146b6f1cd6571602a6b46b2af9 (diff)
downloadgit-f008cef4abb2a4db766b4a152b304aca91a0101a.zip
git-f008cef4abb2a4db766b4a152b304aca91a0101a.tar.gz
git-f008cef4abb2a4db766b4a152b304aca91a0101a.tar.bz2
Merge branch 'jc/apply-ignore-whitespace'
"--ignore-space-change" option of "git apply" ignored the spaces at the beginning of line too aggressively, which is inconsistent with the option of the same name "diff" and "git diff" have. * jc/apply-ignore-whitespace: apply --ignore-space-change: lines with and without leading whitespaces do not match
Diffstat (limited to 't')
-rwxr-xr-xt/t4107-apply-ignore-whitespace.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t4107-apply-ignore-whitespace.sh b/t/t4107-apply-ignore-whitespace.sh
index b04fc8f..9e29b52 100755
--- a/t/t4107-apply-ignore-whitespace.sh
+++ b/t/t4107-apply-ignore-whitespace.sh
@@ -111,7 +111,6 @@ sed -e 's/T/ /g' > main.c.final <<\EOF
#include <stdio.h>
void print_int(int num);
-T/* a comment */
int func(int num);
int main() {
@@ -154,7 +153,8 @@ test_expect_success 'patch2 reverse applies with --ignore-space-change' '
git config apply.ignorewhitespace change
test_expect_success 'patch2 applies (apply.ignorewhitespace = change)' '
- git apply patch2.patch
+ git apply patch2.patch &&
+ test_cmp main.c.final main.c
'
test_expect_success 'patch3 fails (missing string at EOL)' '
@@ -165,12 +165,8 @@ test_expect_success 'patch4 fails (missing EOL at EOF)' '
test_must_fail git apply patch4.patch
'
-test_expect_success 'patch5 applies (leading whitespace)' '
- git apply patch5.patch
-'
-
-test_expect_success 'patches do not mangle whitespace' '
- test_cmp main.c main.c.final
+test_expect_success 'patch5 fails (leading whitespace differences matter)' '
+ test_must_fail git apply patch5.patch
'
test_expect_success 're-create file (with --ignore-whitespace)' '