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
This commit is contained in:
parent
321681cd1b
commit
a05bc6a314
4 changed files with 22 additions and 15 deletions
|
@ -118,6 +118,9 @@ initialize mdescription mversion = checkInitializeAllowed $ \initallowed -> do
|
|||
initSharedClone sharedclone
|
||||
|
||||
u <- getUUID
|
||||
when (u == NoUUID) $
|
||||
giveup "Failed to read annex.uuid from git config after setting it. This should never happen. Please file a bug report."
|
||||
|
||||
{- Avoid overwriting existing description with a default
|
||||
- description. -}
|
||||
whenM (pure (isJust mdescription) <||> not . M.member u <$> uuidDescMapRaw) $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue