summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-15 14:27:14 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-15 14:27:14 -0400
commit68bd845fc0fb486ba99863b5878178ef78d9ad5e (patch)
tree880cd5f08b05ea0fc9e75f551463f85f6c50bf5d
parent5bd2d7e2b897603f156aff13b11b36ee041756e3 (diff)
do tmp dir cleanup in error case too
-rw-r--r--Annex/Direct.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index eb8d4842d..495ff5e75 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -182,8 +182,9 @@ mergeDirect startbranch oldref branch resolvemerge commitmode = exclusively $ do
mergeDirectCommit merged startbranch branch commitmode
liftIO $ whenM (doesFileExist tmpi) $
rename tmpi reali
- else liftIO $ nukeFile tmpi
-
+ else do
+ liftIO $ nukeFile tmpi
+ liftIO $ removeDirectoryRecursive d
return ok
where
exclusively = withExclusiveLock gitAnnexMergeLock
@@ -233,9 +234,7 @@ mergeDirectCommit allowff old branch commitmode = do
canff = maybe (return False) (\o -> inRepo $ Git.Branch.fastForwardable o branch) old
mergeDirectCleanup :: FilePath -> Git.Ref -> Annex ()
-mergeDirectCleanup d oldref = do
- updateWorkTree d oldref False
- liftIO $ removeDirectoryRecursive d
+mergeDirectCleanup d oldref = updateWorkTree d oldref False
{- Updates the direct mode work tree to reflect the changes staged in the
- index by a git command, that was run in a temporary work tree.