Merge branch 'jw/gitweb-sample-update' into maint
[gitweb.git] / t / t1301-shared-repo.sh
index 1312004f8c8ab11b5aafe0eb1f1fb02f1e4f61d5..2dc853d1be5f0fe012d40b5d020fcbfd7638ccb7 100755 (executable)
@@ -19,10 +19,6 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
        )
 '
 
-modebits () {
-       ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
-}
-
 for u in 002 022
 do
        test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
@@ -88,7 +84,7 @@ do
 
                rm -f .git/info/refs &&
                git update-server-info &&
-               actual="$(modebits .git/info/refs)" &&
+               actual="$(test_modebits .git/info/refs)" &&
                verbose test "x$actual" = "x-$y"
 
        '
@@ -98,7 +94,7 @@ do
 
                rm -f .git/info/refs &&
                git update-server-info &&
-               actual="$(modebits .git/info/refs)" &&
+               actual="$(test_modebits .git/info/refs)" &&
                verbose test "x$actual" = "x-$x"
 
        '
@@ -111,7 +107,7 @@ test_expect_success POSIXPERM 'info/refs respects umask in unshared repo' '
        umask 002 &&
        git update-server-info &&
        echo "-rw-rw-r--" >expect &&
-       modebits .git/info/refs >actual &&
+       test_modebits .git/info/refs >actual &&
        test_cmp expect actual
 '
 
@@ -140,7 +136,7 @@ test_expect_success POSIXPERM 'forced modes' '
        (
                cd new &&
                umask 002 &&
-               git init --shared=0660 --template=../templates &&
+               git init --shared=0660 --template=templates &&
                >frotz &&
                git add frotz &&
                git commit -a -m initial &&
@@ -177,7 +173,7 @@ test_expect_success POSIXPERM 'remote init does not use config from cwd' '
        umask 0022 &&
        git init --bare child.git &&
        echo "-rw-r--r--" >expect &&
-       modebits child.git/config >actual &&
+       test_modebits child.git/config >actual &&
        test_cmp expect actual
 '
 
@@ -187,7 +183,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
        echo whatever >templates/foo &&
        git init --template=templates &&
        echo "-rw-rw-rw-" >expect &&
-       modebits .git/foo >actual &&
+       test_modebits .git/foo >actual &&
        test_cmp expect actual
 '
 
@@ -196,9 +192,9 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
        umask 0022 &&
        git init --bare --shared=0666 child.git &&
        test_path_is_missing child.git/foo &&
-       git init --bare --template=../templates child.git &&
+       git init --bare --template=templates child.git &&
        echo "-rw-rw-rw-" >expect &&
-       modebits child.git/foo >actual &&
+       test_modebits child.git/foo >actual &&
        test_cmp expect actual
 '
 
@@ -207,9 +203,9 @@ test_expect_success POSIXPERM 'template can set core.sharedrepository' '
        umask 0022 &&
        git config core.sharedrepository 0666 &&
        cp .git/config templates/config &&
-       git init --bare --template=../templates child.git &&
+       git init --bare --template=templates child.git &&
        echo "-rw-rw-rw-" >expect &&
-       modebits child.git/HEAD >actual &&
+       test_modebits child.git/HEAD >actual &&
        test_cmp expect actual
 '