Fix breakage when git is configured with safe.bareRepository = explicit
authorJoey Hess <joeyh@joeyh.name>
Wed, 5 Jul 2023 18:43:02 +0000 (14:43 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 5 Jul 2023 18:43:14 +0000 (14:43 -0400)
commita05bc6a31459dedd5d199fbc864af2e9d7d1f6d1
tree40ca12f22178bf9607ecd67b06646c212c8ea432
parent321681cd1bdd7f4091281d8b5c92e8d06d9a7fa7
Fix breakage when git is configured with safe.bareRepository = explicit

Running git config --list inside .git then fails, so better to only
do that when --git-dir was specified explicitly. Otherwise, when the
repository is not bare, run the command inside the working tree.

Also make init detect when the uuid it just set cannot be read and fail
with an error, in case git changes something that breaks this later.

I still don't actually understand why git-annex add/assist -J2 was
affected but -J1 was not. But I did show that it was skipping writing to
the location log, because the uuid was NoUUID.

Sponsored-by: Graham Spencer on Patreon
Annex/Init.hs
CHANGELOG
Git/Config.hs
doc/bugs/safe.bareRepository_breaks_git-annex_uuid.mdwn