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

1
debian/changelog vendored
View file

@ -21,6 +21,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium
* required: New command, like wanted, but for required content. * required: New command, like wanted, but for required content.
* Removed dependency on haskell SHA library, * Removed dependency on haskell SHA library,
instead using cryptohash >= 0.11.0. instead using cryptohash >= 0.11.0.
* Make repo init more robust.
* Windows: Renamed start menu file to avoid loop in some versions * Windows: Renamed start menu file to avoid loop in some versions
of Windows where the menu file is treated as a git-annex program. of Windows where the menu file is treated as a git-annex program.
* Windows: Fixed support of remotes on other drives. * Windows: Fixed support of remotes on other drives.