]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t4030-diff-textconv.sh
Merge branch 'maint-1.6.0' into maint
[git.git] / t / t4030-diff-textconv.sh
index 1b0964843e85cc516356f4bc12c46eb32665abf2..a3f0897a52ce2147388baeac6fc64d3b8501b516 100755 (executable)
@@ -21,7 +21,7 @@ EOF
 
 cat >hexdump <<'EOF'
 #!/bin/sh
-perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' "$1"
+perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' "$1"
 EOF
 chmod +x hexdump
 
@@ -29,7 +29,7 @@ test_expect_success 'setup binary file with history' '
        printf "\\0\\n" >file &&
        git add file &&
        git commit -m one &&
-       printf "\\1\\n" >>file &&
+       printf "\\01\\n" >>file &&
        git add file &&
        git commit -m two
 '
@@ -52,7 +52,7 @@ test_expect_success 'setup textconv filters' '
        git config diff.fail.textconv false
 '
 
-test_expect_failure 'diff produces text' '
+test_expect_success 'diff produces text' '
        git diff HEAD^ HEAD >diff &&
        find_diff <diff >actual &&
        test_cmp expect.text actual
@@ -64,23 +64,31 @@ test_expect_success 'diff-tree produces binary' '
        test_cmp expect.binary actual
 '
 
-test_expect_failure 'log produces text' '
+test_expect_success 'log produces text' '
        git log -1 -p >log &&
        find_diff <log >actual &&
        test_cmp expect.text actual
 '
 
-test_expect_failure 'format-patch produces binary' '
+test_expect_success 'format-patch produces binary' '
        git format-patch --no-binary --stdout HEAD^ >patch &&
        find_diff <patch >actual &&
        test_cmp expect.binary actual
 '
 
+test_expect_success 'status -v produces text' '
+       git reset --soft HEAD^ &&
+       git status -v >diff &&
+       find_diff <diff >actual &&
+       test_cmp expect.text actual &&
+       git reset --soft HEAD@{1}
+'
+
 cat >expect.stat <<'EOF'
  file |  Bin 2 -> 4 bytes
  1 files changed, 0 insertions(+), 0 deletions(-)
 EOF
-test_expect_failure 'diffstat does not run textconv' '
+test_expect_success 'diffstat does not run textconv' '
        echo file diff=fail >.gitattributes &&
        git diff --stat HEAD^ HEAD >actual &&
        test_cmp expect.stat actual
@@ -96,7 +104,7 @@ cat >expect.typechange <<'EOF'
 -1
 diff --git a/file b/file
 new file mode 120000
-index ad8b3d2..67be421
+index 0000000..67be421
 --- /dev/null
 +++ b/file
 @@ -0,0 +1 @@
@@ -104,8 +112,8 @@ index ad8b3d2..67be421
 \ No newline at end of file
 EOF
 # make a symlink the hard way that works on symlink-challenged file systems
-test_expect_failure 'textconv does not act on symlinks' '
-       echo -n frotz > file &&
+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 &&