diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:46:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:46:23 -0700 |
commit | c122c9a968d5528b799fd5aeab8e67fffb45ef4d (patch) | |
tree | bd71efe988e971408b48572a23b9032540465d05 /t | |
parent | ff7e96b78f3ad9db61fbdfdeaf7b71f254f76310 (diff) | |
parent | 14d3bb4955a41e146b6f1cd6571602a6b46b2af9 (diff) | |
download | git-c122c9a968d5528b799fd5aeab8e67fffb45ef4d.tar.gz |
Merge branch 'jc/apply-ignore-whitespace' into maint
"--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-x | t/t4107-apply-ignore-whitespace.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t4107-apply-ignore-whitespace.sh b/t/t4107-apply-ignore-whitespace.sh index b04fc8fc12..9e29b5262d 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)' ' |