diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-15 17:17:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-15 17:17:13 -0400 |
commit | 42710158e49f8460ac50b6a77d317b2f6cda4b57 (patch) | |
tree | 627f5546fe591df3191a0dbc287a8262ef70efcd /Annex/Init.hs | |
parent | 49983aafdc36f21aee6aef9a540ac93d7171ab69 (diff) |
Use git-annex init --version=6 to get v6 for now
Not ready to make it default because of the direct mode upgrade needing to
all happen at once.
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r-- | Annex/Init.hs | 18 |
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" ) |