config: only read .git/config from configured repos
[gitweb.git] / t / t1007-hash-object.sh
index ebb3a69c8cd68a51184f809357bb60cb7b35f928..285871c24d88c4667d547e957da682fd78bf6ab9 100755 (executable)
@@ -121,6 +121,17 @@ test_expect_success 'check that appropriate filter is invoke when --path is used
        git config --unset core.autocrlf
 '
 
+test_expect_success 'gitattributes also work in a subdirectory' '
+       mkdir subdir &&
+       (
+               cd subdir &&
+               subdir_sha0=$(git hash-object ../file0) &&
+               subdir_sha1=$(git hash-object ../file1) &&
+               test "$file0_sha" = "$subdir_sha0" &&
+               test "$file1_sha" = "$subdir_sha1"
+       )
+'
+
 test_expect_success 'check that --no-filters option works' '
        echo fooQ | tr Q "\\015" >file0 &&
        cp file0 file1 &&
@@ -209,4 +220,15 @@ test_expect_success 'hash-object complains about truncated type name' '
        test_must_fail git hash-object -t bl --stdin </dev/null
 '
 
+test_expect_success '--literally' '
+       t=1234567890 &&
+       echo example | git hash-object -t $t --literally --stdin
+'
+
+test_expect_success '--literally with extra-long type' '
+       t=12345678901234567890123456789012345678901234567890 &&
+       t="$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t" &&
+       echo example | git hash-object -t $t --literally --stdin
+'
+
 test_done