initremote: Avoid recording remote's description before checking that its config is valid.

This commit is contained in:
Joey Hess 2012-07-27 21:05:27 -04:00
parent 1b8a934e8b
commit 13e9b275dd
3 changed files with 17 additions and 7 deletions

View file

@ -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)

7
debian/changelog vendored
View file

@ -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

View file

@ -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]]