@@ -193,7 +193,6 @@ static void copy_templates(int no_template, const char *template_dir,
len = path.len;
lazy_mkdir_strbuf_or_die_setlen(&path, len, "hooks");
- lazy_mkdir_strbuf_or_die_setlen(&path, len, "branches");
strbuf_release(&path);
}
@@ -929,6 +929,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
(
cd six &&
git remote rm origin &&
+ mkdir .git/branches &&
echo "$origin_url#main" >.git/branches/origin &&
git remote rename origin origin &&
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)'
(
cd seven &&
git remote rm origin &&
+ mkdir .git/branches &&
echo "quux#foom" > .git/branches/origin &&
git remote rename origin origin &&
test_path_is_missing .git/branches/origin &&
@@ -921,6 +921,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 &&
@@ -934,6 +935,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 &&
@@ -948,6 +950,7 @@ test_expect_success 'fetch with branches containing #' '
test_expect_success 'push with branches' '
mk_empty testrepo &&
git checkout second &&
+ mkdir .git/branches &&
echo "testrepo" > .git/branches/branch1 &&
git push branch1 &&
(
As noted in c8a58ac5a52 (Revert "Don't create the $GIT_DIR/branches directory on init", 2009-10-31) there was an attempt long ago in 0cc5691a8b0 (Don't create the $GIT_DIR/branches directory on init, 2009-10-30) to get rid of the legacy "branches" directory. We should probably get rid of its creation by removing the "templates/branches--" file, but whatever we do with that we don't need to be creating it in the templates that drive our own tests. By removing this dependency it'll be more obvious what tests depend on the existence of ".git/branches", and we can remove the first of the three special-cases added to copy_template() in a preceding commit. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- builtin/init-db.c | 1 - t/t5505-remote.sh | 2 ++ t/t5516-fetch-push.sh | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-)