New annex.supportunlocked config

Can beet to false to avoid some expensive things needed to support unlocked
files.

See my comment for why this only controls what init sets up, and not other
behavior.

I didn't bother with making the v5 upgrade code path look at this, though
it easily could, because the docs say to run git-annex init after setting
it to make it take effect.
This commit is contained in:
Joey Hess 2021-03-23 14:04:34 -04:00
parent af96b49145
commit 798f685077
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 71 additions and 3 deletions

View file

@ -128,10 +128,14 @@ initialize' mversion = checkInitializeAllowed $ do
setDifferences
unlessM (isJust <$> getVersion) $
setVersion (fromMaybe defaultVersion mversion)
configureSmudgeFilter
supportunlocked <- annexSupportUnlocked <$> Annex.getGitConfig
if supportunlocked
then configureSmudgeFilter
else deconfigureSmudgeFilter
unlessM isBareRepo $ do
showSideAction "scanning for unlocked files"
scanUnlockedFiles
when supportunlocked $ do
showSideAction "scanning for unlocked files"
scanUnlockedFiles
hookWrite postCheckoutHook
hookWrite postMergeHook
AdjustedBranch.checkAdjustedClone >>= \case