mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-26 03:51:40 -05:00
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:
@@ -1039,7 +1039,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
|
|||||||
(
|
(
|
||||||
cd six &&
|
cd six &&
|
||||||
git remote rm origin &&
|
git remote rm origin &&
|
||||||
mkdir .git/branches &&
|
mkdir -p .git/branches &&
|
||||||
echo "$origin_url#main" >.git/branches/origin &&
|
echo "$origin_url#main" >.git/branches/origin &&
|
||||||
git remote rename origin origin &&
|
git remote rename origin origin &&
|
||||||
test_path_is_missing .git/branches/origin &&
|
test_path_is_missing .git/branches/origin &&
|
||||||
@@ -1054,7 +1054,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)'
|
|||||||
(
|
(
|
||||||
cd seven &&
|
cd seven &&
|
||||||
git remote rm origin &&
|
git remote rm origin &&
|
||||||
mkdir .git/branches &&
|
mkdir -p .git/branches &&
|
||||||
echo "quux#foom" > .git/branches/origin &&
|
echo "quux#foom" > .git/branches/origin &&
|
||||||
git remote rename origin origin &&
|
git remote rename origin origin &&
|
||||||
test_path_is_missing .git/branches/origin &&
|
test_path_is_missing .git/branches/origin &&
|
||||||
|
|||||||
@@ -969,7 +969,7 @@ test_expect_success 'fetch with branches' '
|
|||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
git branch second $the_first_commit &&
|
git branch second $the_first_commit &&
|
||||||
git checkout second &&
|
git checkout second &&
|
||||||
mkdir testrepo/.git/branches &&
|
mkdir -p testrepo/.git/branches &&
|
||||||
echo ".." > testrepo/.git/branches/branch1 &&
|
echo ".." > testrepo/.git/branches/branch1 &&
|
||||||
(
|
(
|
||||||
cd testrepo &&
|
cd testrepo &&
|
||||||
@@ -983,7 +983,7 @@ test_expect_success 'fetch with branches' '
|
|||||||
|
|
||||||
test_expect_success 'fetch with branches containing #' '
|
test_expect_success 'fetch with branches containing #' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
mkdir testrepo/.git/branches &&
|
mkdir -p testrepo/.git/branches &&
|
||||||
echo "..#second" > testrepo/.git/branches/branch2 &&
|
echo "..#second" > testrepo/.git/branches/branch2 &&
|
||||||
(
|
(
|
||||||
cd testrepo &&
|
cd testrepo &&
|
||||||
@@ -1000,7 +1000,7 @@ test_expect_success 'push with branches' '
|
|||||||
git checkout second &&
|
git checkout second &&
|
||||||
|
|
||||||
test_when_finished "rm -rf .git/branches" &&
|
test_when_finished "rm -rf .git/branches" &&
|
||||||
mkdir .git/branches &&
|
mkdir -p .git/branches &&
|
||||||
echo "testrepo" > .git/branches/branch1 &&
|
echo "testrepo" > .git/branches/branch1 &&
|
||||||
|
|
||||||
git push branch1 &&
|
git push branch1 &&
|
||||||
@@ -1016,7 +1016,7 @@ test_expect_success 'push with branches containing #' '
|
|||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
|
|
||||||
test_when_finished "rm -rf .git/branches" &&
|
test_when_finished "rm -rf .git/branches" &&
|
||||||
mkdir .git/branches &&
|
mkdir -p .git/branches &&
|
||||||
echo "testrepo#branch3" > .git/branches/branch2 &&
|
echo "testrepo#branch3" > .git/branches/branch2 &&
|
||||||
|
|
||||||
git push branch2 &&
|
git push branch2 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user