summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-05 15:06:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-05 15:06:20 -0400
commitd360ca3ed9ebfc4abc34694138ff5628838fed5f (patch)
tree305c9979f3e97e6db532fdcc8adfff341f574bf0
parentd31b84c777b6ba7158be8947fc2236b2a15e29bb (diff)
make upgrade more robust
don't remove .git-annex until state has been succeffully saved
-rw-r--r--Upgrade/V2.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Upgrade/V2.hs b/Upgrade/V2.hs
index 14e328edb..4824f4bba 100644
--- a/Upgrade/V2.hs
+++ b/Upgrade/V2.hs
@@ -54,11 +54,13 @@ upgrade = do
when e $ do
mapM_ (\(k, f) -> inject f $ logFile k) =<< locationLogs g
mapM_ (\f -> inject f f) =<< logFiles (olddir g)
- liftIO $ do
- Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
- unless bare $ gitAttributesUnWrite g
saveState
+
+ when e $ liftIO $ do
+ Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
+ unless bare $ gitAttributesUnWrite g
+
unless bare $ push
return True