Re: [PATCH 23/24] t5505,t5516: create .git/branches/ when needed
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 18, 2019, 20:34 UTC
- Message-ID
- <xmqqftn3xet7.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <db69b33ff4a583f75e07f15d10dba70bd99fcaf7.1563455939.git.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 14 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > It is a real old anachronism from the Cogito days to have a > .git/branches/ directory. And to have tests that ensure that Cogito > users can migrate away from using that directory. > > But so be it, let's continue testing it. > > Let's make sure, however, that git init does not need to create that > directory. > > This bug was noticed when testing with templates that had been > pre-committed, skipping the empty branches/ directory of course because > Git does not track empty directories.
Many tests assume that the .git/info/ directory exists, and the only reason why they can is because we have templates/info--exclude; the situation around .git/branches/ is exactly the same.
Deprecating .git/branches/ directory and dropping the parts of tests that wants to make sure the support still works (t5516 is not about migration but about working with .git/branches configuration) would be a different matter. Until that happens, let's not do this patch; otherwise it would force us to sprinkle "mkdir -p .git/info/" all over the place for the same rationale. A directory in .git/ created by hardcoded mkdir in "git init" (like .git/refs/) and created by copying templates by "git init" (like .git/info/ and .git/branches) are both "created by 'git init'". Special casing the latter is just silly.