summaryrefslogtreecommitdiff
path: root/Annex/Init.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r--Annex/Init.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Annex/Init.hs b/Annex/Init.hs
index 997312c31..99bb03e92 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -57,8 +57,8 @@ genDescription Nothing = do
return $ concat [hostname, ":", reldir]
#endif
-initialize :: Maybe String -> Annex ()
-initialize mdescription = do
+initialize :: Maybe String -> Maybe Version -> Annex ()
+initialize mdescription mversion = do
{- Has to come before any commits are made as the shared
- clone heuristic expects no local objects. -}
sharedclone <- checkSharedClone
@@ -68,7 +68,7 @@ initialize mdescription = do
ensureCommit $ Annex.Branch.create
prepUUID
- initialize'
+ initialize' mversion
initSharedClone sharedclone
@@ -77,16 +77,18 @@ initialize mdescription = do
-- Everything except for uuid setup, shared clone setup, and initial
-- description.
-initialize' :: Annex ()
-initialize' = do
+initialize' :: Maybe Version -> Annex ()
+initialize' mversion = do
checkLockSupport
checkFifoSupport
checkCrippledFileSystem
unlessM isBare $
hookWrite preCommitHook
setDifferences
- setVersion currentVersion
- configureSmudgeFilter
+ unlessM (isJust <$> getVersion) $
+ setVersion (fromMaybe defaultVersion mversion)
+ whenM versionSupportsUnlockedPointers
+ configureSmudgeFilter
ifM (crippledFileSystem <&&> not <$> isBare)
( do
enableDirectMode
@@ -115,7 +117,7 @@ ensureInitialized :: Annex ()
ensureInitialized = getVersion >>= maybe needsinit checkUpgrade
where
needsinit = ifM Annex.Branch.hasSibling
- ( initialize Nothing
+ ( initialize Nothing Nothing
, error "First run: git-annex init"
)