From ce62996c449959fafdc29ce54e62eaee13d96628 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 14:01:41 -0400 Subject: 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. --- Annex/Init.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Annex') diff --git a/Annex/Init.hs b/Annex/Init.hs index 50f4d8522..2cc1c1897 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -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 () -- cgit v1.2.3