Make repo init more robust.

The setDifferences that got added to initialize turns out to make a git
commit, and before ensureCommit has been used. Thus, repo init can fail
when the system has a broken hostname etc.

Move the ensureCommit to the very first thing to avoid this kind of breakage.
This commit is contained in:
Joey Hess 2015-04-20 14:01:41 -04:00
parent fdf0d708d2
commit 5948c148fb
2 changed files with 6 additions and 5 deletions

View file

@ -57,15 +57,15 @@ genDescription Nothing = do
initialize :: Maybe String -> Annex ()
initialize mdescription = do
{- This will make the first commit to git, so ensure git is set up
- properly to allow commits when running it. -}
ensureCommit $ Annex.Branch.create
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
describeUUID u =<< genDescription mdescription
-- Everything except for uuid setup.
initialize' :: Annex ()