]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t1007-hash-object.sh
Merge branch 'bd/diff-strbuf'
[git.git] / t / t1007-hash-object.sh
index f3972a79afe515fb02b3d984c5185e0a723aab1b..fcdd15a358f8a82b617f8ac7b22e5051975b1a4a 100755 (executable)
@@ -65,6 +65,14 @@ test_expect_success "Can't use --path with --stdin-paths" '
        echo example | test_must_fail git hash-object --stdin-paths --path=foo
 '
 
+test_expect_success "Can't use --stdin-paths with --no-filters" '
+       echo example | test_must_fail git hash-object --stdin-paths --no-filters
+'
+
+test_expect_success "Can't use --path with --no-filters" '
+       test_must_fail git hash-object --no-filters --path=foo
+'
+
 # Behavior
 
 push_repo
@@ -117,6 +125,22 @@ test_expect_success 'check that appropriate filter is invoke when --path is used
        git config --unset core.autocrlf
 '
 
+test_expect_success 'check that --no-filters option works' '
+       echo fooQ | tr Q "\\015" >file0 &&
+       cp file0 file1 &&
+       echo "file0 -crlf" >.gitattributes &&
+       echo "file1 crlf" >>.gitattributes &&
+       git config core.autocrlf true &&
+       file0_sha=$(git hash-object file0) &&
+       file1_sha=$(git hash-object file1) &&
+       test "$file0_sha" != "$file1_sha" &&
+       nofilters_file1=$(git hash-object --no-filters file1) &&
+       test "$file0_sha" = "$nofilters_file1" &&
+       nofilters_file1=$(cat file1 | git hash-object --stdin) &&
+       test "$file0_sha" = "$nofilters_file1" &&
+       git config --unset core.autocrlf
+'
+
 pop_repo
 
 for args in "-w --stdin" "--stdin -w"; do