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:
authorJunio C Hamano <gitster@pobox.com>2022-07-18 23:31:55 +0300
committerJunio C Hamano <gitster@pobox.com>2022-07-18 23:31:55 +0300
commit3d3874d537af1149c85b73d7c4317ed1b0d0b419 (patch)
tree577fde64cf3c19bd7a39bc526a02d49b17113f49 /t/t5516-fetch-push.sh
parent48e88a4862f3f0353f7a795dae0346dca0043829 (diff)
parentead74601c6ed7171e9e736e329b45c12d90153e4 (diff)
Merge branch 'ab/test-without-templates'
Tweak tests so that they still work when the "git init" template did not create .git/info directory. * ab/test-without-templates: tests: don't assume a .git/info for .git/info/sparse-checkout tests: don't assume a .git/info for .git/info/exclude tests: don't assume a .git/info for .git/info/refs tests: don't assume a .git/info for .git/info/attributes tests: don't assume a .git/info for .git/info/grafts tests: don't depend on template-created .git/branches t0008: don't rely on default ".git/info/exclude"
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 9ca0f8c144..f3356f9ea8 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -18,6 +18,7 @@ This test checks the following functionality:
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_CREATE_REPO_NO_TEMPLATE=1
. ./test-lib.sh
D=$(pwd)
@@ -26,7 +27,8 @@ mk_empty () {
repo_name="$1"
test_when_finished "rm -rf \"$repo_name\"" &&
test_path_is_missing "$repo_name" &&
- git init "$repo_name" &&
+ git init --template= "$repo_name" &&
+ mkdir "$repo_name"/.git/hooks &&
git -C "$repo_name" config receive.denyCurrentBranch warn
}
@@ -78,7 +80,7 @@ mk_test_with_hooks() {
mk_child() {
test_when_finished "rm -rf \"$2\"" &&
- git clone "$1" "$2"
+ git clone --template= "$1" "$2"
}
check_push_result () {
@@ -937,6 +939,7 @@ test_expect_success 'fetch with branches' '
mk_empty testrepo &&
git branch second $the_first_commit &&
git checkout second &&
+ mkdir testrepo/.git/branches &&
echo ".." > testrepo/.git/branches/branch1 &&
(
cd testrepo &&
@@ -950,6 +953,7 @@ test_expect_success 'fetch with branches' '
test_expect_success 'fetch with branches containing #' '
mk_empty testrepo &&
+ mkdir testrepo/.git/branches &&
echo "..#second" > testrepo/.git/branches/branch2 &&
(
cd testrepo &&
@@ -964,7 +968,11 @@ test_expect_success 'fetch with branches containing #' '
test_expect_success 'push with branches' '
mk_empty testrepo &&
git checkout second &&
+
+ test_when_finished "rm -rf .git/branches" &&
+ mkdir .git/branches &&
echo "testrepo" > .git/branches/branch1 &&
+
git push branch1 &&
(
cd testrepo &&
@@ -976,7 +984,11 @@ test_expect_success 'push with branches' '
test_expect_success 'push with branches containing #' '
mk_empty testrepo &&
+
+ test_when_finished "rm -rf .git/branches" &&
+ mkdir .git/branches &&
echo "testrepo#branch3" > .git/branches/branch2 &&
+
git push branch2 &&
(
cd testrepo &&