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
This commit is contained in:
@ -8,6 +8,7 @@ test_description='Test shared repository initialization'
|
|||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_CREATE_REPO_NO_TEMPLATE=1
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Remove a default ACL from the test dir if possible.
|
# 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
|
for u in 002 022
|
||||||
do
|
do
|
||||||
test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
|
test_expect_success POSIXPERM "shared=1 does not clear bits preset by umask $u" '
|
||||||
|
test_when_finished "rm -rf sub" &&
|
||||||
mkdir sub && (
|
mkdir sub && (
|
||||||
cd sub &&
|
cd sub &&
|
||||||
umask $u &&
|
umask $u &&
|
||||||
@ -42,12 +44,9 @@ do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
'
|
'
|
||||||
rm -rf sub
|
|
||||||
done
|
done
|
||||||
|
|
||||||
test_expect_success 'shared=all' '
|
test_expect_success 'shared=all' '
|
||||||
mkdir sub &&
|
|
||||||
cd sub &&
|
|
||||||
git init --template= --shared=all &&
|
git init --template= --shared=all &&
|
||||||
test 2 = $(git config core.sharedrepository)
|
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_expect_success POSIXPERM 'forced modes' '
|
||||||
|
test_when_finished "rm -rf new" &&
|
||||||
mkdir -p templates/hooks &&
|
mkdir -p templates/hooks &&
|
||||||
echo update-server-info >templates/hooks/post-update &&
|
echo update-server-info >templates/hooks/post-update &&
|
||||||
chmod +x templates/hooks/post-update &&
|
chmod +x templates/hooks/post-update &&
|
||||||
@ -140,7 +140,8 @@ test_expect_success POSIXPERM 'forced modes' '
|
|||||||
(
|
(
|
||||||
cd new &&
|
cd new &&
|
||||||
umask 002 &&
|
umask 002 &&
|
||||||
git init --shared=0660 --template=templates &&
|
git init --shared=0660 --template=../templates &&
|
||||||
|
test_path_is_file .git/hooks/post-update &&
|
||||||
>frotz &&
|
>frotz &&
|
||||||
git add frotz &&
|
git add frotz &&
|
||||||
git commit -a -m initial &&
|
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_expect_success POSIXPERM 'remote init does not use config from cwd' '
|
||||||
|
test_when_finished "rm -rf child.git" &&
|
||||||
git config core.sharedrepository 0666 &&
|
git config core.sharedrepository 0666 &&
|
||||||
umask 0022 &&
|
umask 0022 &&
|
||||||
git init --bare child.git &&
|
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)' '
|
test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' '
|
||||||
rm -rf child.git &&
|
test_when_finished "rm -rf child.git" &&
|
||||||
umask 0022 &&
|
umask 0022 &&
|
||||||
git init --bare --shared=0666 child.git &&
|
git init --bare --shared=0666 child.git &&
|
||||||
test_path_is_missing child.git/foo &&
|
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' '
|
test_expect_success POSIXPERM 'template can set core.sharedrepository' '
|
||||||
rm -rf child.git &&
|
test_when_finished "rm -rf child.git" &&
|
||||||
umask 0022 &&
|
umask 0022 &&
|
||||||
git config core.sharedrepository 0666 &&
|
git config core.sharedrepository 0666 &&
|
||||||
cp .git/config templates/config &&
|
cp .git/config templates/config &&
|
||||||
|
Reference in New Issue
Block a user