test_cmp expect actual
'
-test_expect_failure 'show --textconv blob produces text' '
+test_expect_success 'show --textconv blob produces text' '
git show --textconv HEAD:file >actual &&
printf "0\\n1\\n" >expect &&
test_cmp expect actual
'
-test_success 'show --no-textconv blob produces binary' '
- git show --textconv HEAD:file >actual &&
+test_expect_success 'show --no-textconv blob produces binary' '
+ git show --no-textconv HEAD:file >actual &&
printf "\\0\\n\\01\\n" >expect &&
test_cmp expect actual
'
# restore working setup
echo file diff=foo >.gitattributes
-cat >expect.typechange <<'EOF'
+symlink=$(git rev-parse --short $(printf frotz | git hash-object --stdin))
+cat >expect.typechange <<EOF
--- a/file
+++ /dev/null
@@ -1,2 +0,0 @@
-1
diff --git a/file b/file
new file mode 120000
-index 0000000..67be421
+index 0000000..$symlink
--- /dev/null
+++ b/file
@@ -0,0 +1 @@
+frotz
\ No newline at end of file
EOF
-# make a symlink the hard way that works on symlink-challenged file systems
+
test_expect_success 'textconv does not act on symlinks' '
- printf frotz > file &&
- git add file &&
- git ls-files -s | sed -e s/100644/120000/ |
- git update-index --index-info &&
+ rm -f file &&
+ test_ln_s_add frotz file &&
git commit -m typechange &&
git show >diff &&
find_diff <diff >actual &&