]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0003-attributes.sh
Add global and system-wide gitattributes
[thirdparty/git.git] / t / t0003-attributes.sh
index 53bd7fcc4abbf6cb7db73b43d5dde477f5115f90..a7e24edf5b0ac3157ab2772f3cd94db176e810c1 100755 (executable)
@@ -36,6 +36,9 @@ test_expect_success 'setup' '
                echo "d/* test=a/b/d/*"
                echo "d/yes notest"
        ) >a/b/.gitattributes
+       (
+               echo "global test=global"
+       ) >$HOME/global-gitattributes
 
 '
 
@@ -57,6 +60,16 @@ test_expect_success 'attribute test' '
 
 '
 
+test_expect_success 'core.attributesfile' '
+       attr_check global unspecified &&
+       git config core.attributesfile "$HOME/global-gitattributes" &&
+       attr_check global global &&
+       git config core.attributesfile "~/global-gitattributes" &&
+       attr_check global global &&
+       echo "global test=precedence" >> .gitattributes &&
+       attr_check global precedence
+'
+
 test_expect_success 'attribute test: read paths from stdin' '
 
        cat <<EOF > expect