summaryrefslogtreecommitdiff
path: root/t/t0020-crlf.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-17 12:37:25 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-17 15:27:47 -0800
commit6716027108f426c83038b05baf3f20ceefe6fbd1 (patch)
tree0bc3ccc535c35dd30c1e003a8c759f5800c62122 /t/t0020-crlf.sh
parent634ede32ae7d4c76e96e88f9cd5c1b3a70ea08ac (diff)
downloadgit-6716027108f426c83038b05baf3f20ceefe6fbd1.tar.gz
Teach core.autocrlf to 'git apply'
This teaches git-apply that the data read from and written to the filesystem might need to get converted to adjust for local line-ending convention. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t0020-crlf.sh')
-rwxr-xr-xt/t0020-crlf.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 58a4d86df3..723b29ad17 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -180,11 +180,8 @@ test_expect_success 'apply patch (autocrlf=true)' '
git repo-config core.autocrlf true &&
git read-tree --reset -u HEAD &&
- # Sore thumb
- remove_cr one >tmp && mv -f tmp one &&
-
git apply patch.file &&
- test "$patched" = "`git hash-object --stdin <one`" || {
+ test "$patched" = "`remove_cr one | git hash-object --stdin`" || {
echo "Eh? apply without index"
false
}
@@ -203,4 +200,18 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
}
'
+test_expect_success 'apply patch --index (autocrlf=true)' '
+
+ rm -f tmp one dir/two &&
+ git repo-config core.autocrlf true &&
+ git read-tree --reset -u HEAD &&
+
+ git apply --index patch.file &&
+ test "$patched" = `git rev-parse :one` &&
+ test "$patched" = "`remove_cr one | git hash-object --stdin`" || {
+ echo "Eh? apply with --index"
+ false
+ }
+'
+
test_done