Skip to content

Commit

Permalink
t5505/t5516: allow running without .git/branches/ in the templates
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Sep 24, 2024
1 parent 8801afc commit 189d1cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions t/t5505-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
(
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 &&
Expand All @@ -1054,7 +1054,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)'
(
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 &&
Expand Down
8 changes: 4 additions & 4 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ test_expect_success '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 &&
Expand All @@ -993,7 +993,7 @@ test_expect_success 'fetch with branches' '

test_expect_success 'fetch with branches containing #' '
mk_empty testrepo &&
mkdir testrepo/.git/branches &&
mkdir -p testrepo/.git/branches &&
echo "..#second" > testrepo/.git/branches/branch2 &&
(
cd testrepo &&
Expand All @@ -1010,7 +1010,7 @@ test_expect_success '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 &&
Expand All @@ -1026,7 +1026,7 @@ test_expect_success '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 &&
Expand Down

0 comments on commit 189d1cd

Please sign in to comment.