summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-01-22 01:21:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-01-22 01:21:58 (GMT)
commit90c47b3fbabd6ffecfd234911841892b562cfe9e (patch)
tree57f38aa37cb6f24efab8189572a62688c73fa097 /t
parent904d404274fef6695c78a6b055edd184b72e2f9b (diff)
parentbcb71d45bf7663c181eec81931ee334d29bb16f7 (diff)
downloadgit-90c47b3fbabd6ffecfd234911841892b562cfe9e.zip
git-90c47b3fbabd6ffecfd234911841892b562cfe9e.tar.gz
git-90c47b3fbabd6ffecfd234911841892b562cfe9e.tar.bz2
Merge branch 'jx/t1301-updates'
Test updates. * jx/t1301-updates: t1301: do not change $CWD in "shared=all" test case t1301: use test_when_finished for cleanup t1301: fix wrong template dir for git-init
Diffstat (limited to 't')
-rwxr-xr-xt/t1301-shared-repo.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 93a2f91..58d6da7 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -8,6 +8,7 @@ test_description='Test shared repository initialization'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
# Remove a default ACL from the test dir if possible.
@@ -25,6 +26,7 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
for u in 002 022
do
test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
+ test_when_finished "rm -rf sub" &&
mkdir sub && (
cd sub &&
umask $u &&
@@ -42,12 +44,9 @@ do
;;
esac
'
- rm -rf sub
done
test_expect_success 'shared=all' '
- mkdir sub &&
- cd sub &&
git init --template= --shared=all &&
test 2 = $(git config core.sharedrepository)
'
@@ -132,6 +131,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
'
test_expect_success POSIXPERM 'forced modes' '
+ test_when_finished "rm -rf new" &&
mkdir -p templates/hooks &&
echo update-server-info >templates/hooks/post-update &&
chmod +x templates/hooks/post-update &&
@@ -140,7 +140,8 @@ test_expect_success POSIXPERM 'forced modes' '
(
cd new &&
umask 002 &&
- git init --shared=0660 --template=templates &&
+ git init --shared=0660 --template=../templates &&
+ test_path_is_file .git/hooks/post-update &&
>frotz &&
git add frotz &&
git commit -a -m initial &&
@@ -173,6 +174,7 @@ test_expect_success POSIXPERM 'forced modes' '
'
test_expect_success POSIXPERM 'remote init does not use config from cwd' '
+ test_when_finished "rm -rf child.git" &&
git config core.sharedrepository 0666 &&
umask 0022 &&
git init --bare child.git &&
@@ -192,7 +194,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
'
test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' '
- rm -rf child.git &&
+ test_when_finished "rm -rf child.git" &&
umask 0022 &&
git init --bare --shared=0666 child.git &&
test_path_is_missing child.git/foo &&
@@ -203,7 +205,7 @@ test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)'
'
test_expect_success POSIXPERM 'template can set core.sharedrepository' '
- rm -rf child.git &&
+ test_when_finished "rm -rf child.git" &&
umask 0022 &&
git config core.sharedrepository 0666 &&
cp .git/config templates/config &&