Skip to content

Commit 410e66f

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 <[email protected]>
1 parent 7368e6b commit 410e66f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

t/t5505-remote.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
929929
(
930930
cd six &&
931931
git remote rm origin &&
932+
mkdir -p .git/branches &&
932933
echo "$origin_url#main" >.git/branches/origin &&
933934
git remote rename origin origin &&
934935
test_path_is_missing .git/branches/origin &&
@@ -943,6 +944,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)'
943944
(
944945
cd seven &&
945946
git remote rm origin &&
947+
mkdir -p .git/branches &&
946948
echo "quux#foom" > .git/branches/origin &&
947949
git remote rename origin origin &&
948950
test_path_is_missing .git/branches/origin &&

t/t5516-fetch-push.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ test_expect_success 'fetch with branches' '
908908
mk_empty testrepo &&
909909
git branch second $the_first_commit &&
910910
git checkout second &&
911+
mkdir -p testrepo/.git/branches &&
911912
echo ".." > testrepo/.git/branches/branch1 &&
912913
(
913914
cd testrepo &&
@@ -921,6 +922,7 @@ test_expect_success 'fetch with branches' '
921922

922923
test_expect_success 'fetch with branches containing #' '
923924
mk_empty testrepo &&
925+
mkdir -p testrepo/.git/branches &&
924926
echo "..#second" > testrepo/.git/branches/branch2 &&
925927
(
926928
cd testrepo &&
@@ -935,6 +937,7 @@ test_expect_success 'fetch with branches containing #' '
935937
test_expect_success 'push with branches' '
936938
mk_empty testrepo &&
937939
git checkout second &&
940+
mkdir -p .git/branches &&
938941
echo "testrepo" > .git/branches/branch1 &&
939942
git push branch1 &&
940943
(
@@ -947,6 +950,7 @@ test_expect_success 'push with branches' '
947950

948951
test_expect_success 'push with branches containing #' '
949952
mk_empty testrepo &&
953+
mkdir -p .git/branches &&
950954
echo "testrepo#branch3" > .git/branches/branch2 &&
951955
git push branch2 &&
952956
(

0 commit comments

Comments
 (0)