summaryrefslogtreecommitdiff
path: root/Annex/Init.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r--Annex/Init.hs31
1 files changed, 17 insertions, 14 deletions
diff --git a/Annex/Init.hs b/Annex/Init.hs
index 8c20e5e12..f2996993a 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -93,20 +93,23 @@ initialize' mversion = do
whenM versionSupportsUnlockedPointers $ do
configureSmudgeFilter
Database.Keys.scanAssociatedFiles
- whenM checkAdjustedClone $
- void $ upgrade True
- ifM (crippledFileSystem <&&> (not <$> isBare))
- ( ifM versionSupportsUnlockedPointers
- ( adjustToCrippledFileSystem
- , do
- enableDirectMode
- setDirect True
- )
- -- Handle case where this repo was cloned from a
- -- direct mode repo
- , unlessM isBare
- switchHEADBack
- )
+ v <- checkAdjustedClone
+ case v of
+ NeedUpgradeForAdjustedClone -> void $ upgrade True
+ InAdjustedClone -> return ()
+ NotInAdjustedClone ->
+ ifM (crippledFileSystem <&&> (not <$> isBare))
+ ( ifM versionSupportsUnlockedPointers
+ ( adjustToCrippledFileSystem
+ , do
+ enableDirectMode
+ setDirect True
+ )
+ -- Handle case where this repo was cloned from a
+ -- direct mode repo
+ , unlessM isBare
+ switchHEADBack
+ )
createInodeSentinalFile False
uninitialize :: Annex ()