mirror of
https://github.com/git/git.git
synced 2026-11-17 10:53:46 +01:00
Both the "files" and "reftable" backends accept a payload that allows the user to use a non-default location for their files. So e.g. if the user specifies "files://refdir" as the ref storage format, then we would put files into ".git/refdir/refs" instead of ".git/refs". Using this is somewhat unwieldy though, as the directory must exist before we create the ref storage as we'd otherwise die. This isn't that bad in the case where the user specifies an absolute path that is outside of the repository. But it becomes quite weird when asked to create the directory relative to commondir, as the user would first have to "mkdir -p repo/.git/refdir". Adapt the reference backends to create leading directories. Note that we use the `noshare()` variant for this because it's very much possible that it will exist outside of the repository, and if so we shouldn't adapt permissions on such leading directories. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>