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 +++++----- debian/changelog | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) 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 () diff --git a/debian/changelog b/debian/changelog index 9248df329..2628369bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * required: New command, like wanted, but for required content. * Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. + * Make repo init more robust. * Windows: Renamed start menu file to avoid loop in some versions of Windows where the menu file is treated as a git-annex program. * Windows: Fixed support of remotes on other drives. -- cgit v1.2.3