Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-06-25 07:34:28 +0300
committerJunio C Hamano <gitster@pobox.com>2017-06-25 20:42:52 +0300
commit73de1c93adbdac279c10668afbc7ba6e48a7ccac (patch)
tree246288b78b4ff3ddc3af3d6c6727bde80e630a35 /t/t1301-shared-repo.sh
parentdf801f3f9f5be52842239f0d0233d5c3fb0cdffd (diff)
t1301: move modebits() to test-lib-functions.sh
As the modebits() function can be useful outside t1301, let's move it into test-lib-functions.sh, and while at it let's rename it test_modebits(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1301-shared-repo.sh')
-rwxr-xr-xt/t1301-shared-repo.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 1312004f8c..dfece751b5 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -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
'
@@ -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
'
@@ -198,7 +194,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
test_path_is_missing child.git/foo &&
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
'
@@ -209,7 +205,7 @@ test_expect_success POSIXPERM 'template can set core.sharedrepository' '
cp .git/config templates/config &&
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
'