summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-20 14:01:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-20 14:01:41 -0400
commitce62996c449959fafdc29ce54e62eaee13d96628 (patch)
treea879b46e3f639ddc6e43ff89b6031ff72afed01b
parent2f2921b8bad2a5f6ee339f058bb8cad2b305e8a1 (diff)
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.
-rw-r--r--Annex/Init.hs10
-rw-r--r--debian/changelog1
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.