Merge branch 'jh/rlimit-nofile-fallback'
[gitweb.git] / t / t0003-attributes.sh
index 1035a14b37203202a5476f65d07f9bc505bfb52c..b9d79476e20b4ddf0f9e85c672df2061fb910f9d 100755 (executable)
@@ -13,7 +13,6 @@ attr_check () {
        test_line_count = 0 err
 }
 
-
 test_expect_success 'setup' '
        mkdir -p a/b/d a/c b &&
        (
@@ -207,6 +206,43 @@ test_expect_success 'patterns starting with exclamation' '
        attr_check "!f" foo
 '
 
+test_expect_success '"**" test' '
+       echo "**/f foo=bar" >.gitattributes &&
+       cat <<\EOF >expect &&
+f: foo: bar
+a/f: foo: bar
+a/b/f: foo: bar
+a/b/c/f: foo: bar
+EOF
+       git check-attr foo -- "f" >actual 2>err &&
+       git check-attr foo -- "a/f" >>actual 2>>err &&
+       git check-attr foo -- "a/b/f" >>actual 2>>err &&
+       git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
+       test_cmp expect actual &&
+       test_line_count = 0 err
+'
+
+test_expect_success '"**" with no slashes test' '
+       echo "a**f foo=bar" >.gitattributes &&
+       git check-attr foo -- "f" >actual &&
+       cat <<\EOF >expect &&
+f: foo: unspecified
+af: foo: bar
+axf: foo: bar
+a/f: foo: unspecified
+a/b/f: foo: unspecified
+a/b/c/f: foo: unspecified
+EOF
+       git check-attr foo -- "f" >actual 2>err &&
+       git check-attr foo -- "af" >>actual 2>err &&
+       git check-attr foo -- "axf" >>actual 2>err &&
+       git check-attr foo -- "a/f" >>actual 2>>err &&
+       git check-attr foo -- "a/b/f" >>actual 2>>err &&
+       git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
+       test_cmp expect actual &&
+       test_line_count = 0 err
+'
+
 test_expect_success 'setup bare' '
        git clone --bare . bare.git &&
        cd bare.git