summaryrefslogtreecommitdiff
path: root/Annex/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-06-02 15:58:22 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-06-02 16:10:30 -0400
commitd8b894c5cbb430c17e61f8c2d001c03b567bfb12 (patch)
treeb9e2eb70b02d102e2caaa30998ec87cd8d50d3c8 /Annex/Init.hs
parent914cf84bdb8441746f3388391f0218a5f1f63443 (diff)
better avoid switching to direct mode in clone of adjusted branch repo
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 ()