diff options
author | 2014-04-15 20:13:35 -0400 | |
---|---|---|
committer | 2014-04-15 20:13:35 -0400 | |
commit | dc748c7336aea9cbf04c0311098a44c2b329633d (patch) | |
tree | 1a993dd9662ff046b74a427232b8e301500a97b8 /Annex/Init.hs | |
parent | 60c4bcefd4d3001e7025fc59c1f7ab927a3a5c34 (diff) |
reinit: New command that can initialize a new reposotory using the configuration of a previously known repository. Useful if a repository got deleted and you want to clone it back the way it was.
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r-- | Annex/Init.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Annex/Init.hs b/Annex/Init.hs index 0cb41872c..637b130ee 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -11,6 +11,7 @@ module Annex.Init ( ensureInitialized, isInitialized, initialize, + initialize', uninitialize, probeCrippledFileSystem, ) where @@ -60,6 +61,17 @@ genDescription Nothing = do initialize :: Maybe String -> Annex () initialize mdescription = do prepUUID + initialize' + + u <- getUUID + {- This will make the first commit to git, so ensure git is set up + - properly to allow commits when running it. -} + ensureCommit $ do + Annex.Branch.create + describeUUID u =<< genDescription mdescription + +initialize' :: Annex () +initialize' = do checkFifoSupport checkCrippledFileSystem unlessM isBare $ @@ -75,12 +87,6 @@ initialize mdescription = do switchHEADBack ) createInodeSentinalFile - u <- getUUID - {- This will make the first commit to git, so ensure git is set up - - properly to allow commits when running it. -} - ensureCommit $ do - Annex.Branch.create - describeUUID u =<< genDescription mdescription uninitialize :: Annex () uninitialize = do |