diff options
author | 2011-07-05 15:06:20 -0400 | |
---|---|---|
committer | 2011-07-05 15:06:20 -0400 | |
commit | d360ca3ed9ebfc4abc34694138ff5628838fed5f (patch) | |
tree | 305c9979f3e97e6db532fdcc8adfff341f574bf0 /Upgrade/V2.hs | |
parent | d31b84c777b6ba7158be8947fc2236b2a15e29bb (diff) |
make upgrade more robust
don't remove .git-annex until state has been succeffully saved
Diffstat (limited to 'Upgrade/V2.hs')
-rw-r--r-- | Upgrade/V2.hs | 8 |
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 |