t5505/t5516: allow running without .git/branches/ in the templates

When we commit the template directory as part of `make vcxproj`, the
`branches/` directory is not actually commited, as it is empty.

Two tests were not prepared for that situation.

This developer tried to get rid of the support for `.git/branches/` a
long time ago, but that effort did not bear fruit, so the best we can do
is work around in these here tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2020-05-09 16:19:06 +02:00
parent b4f0424fce
commit 52fa2ffb2c
2 changed files with 6 additions and 6 deletions

View File

@ -1155,7 +1155,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in
(
cd six &&
git remote rm origin &&
mkdir .git/branches &&
mkdir -p .git/branches &&
echo "$origin_url#main" >.git/branches/origin &&
git remote rename origin origin &&
test_path_is_missing .git/branches/origin &&
@ -1170,7 +1170,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in
(
cd seven &&
git remote rm origin &&
mkdir .git/branches &&
mkdir -p .git/branches &&
echo "quux#foom" > .git/branches/origin &&
git remote rename origin origin &&
test_path_is_missing .git/branches/origin &&

View File

@ -933,7 +933,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
mk_empty testrepo &&
git branch second $the_first_commit &&
git checkout second &&
mkdir testrepo/.git/branches &&
mkdir -p testrepo/.git/branches &&
echo ".." > testrepo/.git/branches/branch1 &&
(
cd testrepo &&
@ -947,7 +947,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches containing #' '
mk_empty testrepo &&
mkdir testrepo/.git/branches &&
mkdir -p testrepo/.git/branches &&
echo "..#second" > testrepo/.git/branches/branch2 &&
(
cd testrepo &&
@ -964,7 +964,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'push with branches' '
git checkout second &&
test_when_finished "rm -rf .git/branches" &&
mkdir .git/branches &&
mkdir -p .git/branches &&
echo "testrepo" > .git/branches/branch1 &&
git push branch1 &&
@ -980,7 +980,7 @@ test_expect_success !WITH_BREAKING_CHANGES 'push with branches containing #' '
mk_empty testrepo &&
test_when_finished "rm -rf .git/branches" &&
mkdir .git/branches &&
mkdir -p .git/branches &&
echo "testrepo#branch3" > .git/branches/branch2 &&
git push branch2 &&