summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-27 21:05:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-27 21:05:27 -0400
commit13e9b275dd96673e5a3421b64d672abdd29e9a26 (patch)
treece30b153787a7e634d2260d86f18ddf8726bb9ef
parent1b8a934e8be28ac8632f9345f867d68203d84cd1 (diff)
initremote: Avoid recording remote's description before checking that its config is valid.
-rw-r--r--Command/InitRemote.hs14
-rw-r--r--debian/changelog7
-rw-r--r--doc/bugs/git_annex_initremote_needs_some___34__error_checking__34__.mdwn3
3 files changed, 17 insertions, 7 deletions
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index a78505a19..ad93529cc 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -38,18 +38,19 @@ start (name:ws) = do
t <- findType fullconfig
showStart "initremote" name
- next $ perform t u $ M.union config c
+ next $ perform t u name $ M.union config c
where
config = Logs.Remote.keyValToConfig ws
-perform :: RemoteType -> UUID -> R.RemoteConfig -> CommandPerform
-perform t u c = do
+perform :: RemoteType -> UUID -> String -> R.RemoteConfig -> CommandPerform
+perform t u name c = do
c' <- R.setup t u c
- next $ cleanup u c'
+ next $ cleanup u name c'
-cleanup :: UUID -> R.RemoteConfig -> CommandCleanup
-cleanup u c = do
+cleanup :: UUID -> String -> R.RemoteConfig -> CommandCleanup
+cleanup u name c = do
+ describeUUID u name
Logs.Remote.configSet u c
return True
@@ -61,7 +62,6 @@ findByName name = do
where
generate = do
uuid <- liftIO genUUID
- describeUUID uuid name
return (uuid, M.insert nameKey name M.empty)
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
diff --git a/debian/changelog b/debian/changelog
index 387dacd53..82bf5009a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+git-annex (3.20120722) UNRELEASED; urgency=low
+
+ * initremote: Avoid recording remote's description before checking
+ that its config is valid.
+
+ -- Joey Hess <joeyh@debian.org> Fri, 27 Jul 2012 21:04:47 -0400
+
git-annex (3.20120721) unstable; urgency=low
* get, move, copy: Now refuse to do anything when the requested file
diff --git a/doc/bugs/git_annex_initremote_needs_some___34__error_checking__34__.mdwn b/doc/bugs/git_annex_initremote_needs_some___34__error_checking__34__.mdwn
index 3521038d7..6b57f8ce5 100644
--- a/doc/bugs/git_annex_initremote_needs_some___34__error_checking__34__.mdwn
+++ b/doc/bugs/git_annex_initremote_needs_some___34__error_checking__34__.mdwn
@@ -60,3 +60,6 @@ bloom filter size: 16 mebibytes (0% full)
backend usage:
x00:atest jtang$
</pre>
+
+> Indeed, I broke that in June by making it record the name in a much too
+> early stage. Now fixed. [[done]] --[[Joey]]