From: Joey Hess Date: Thu, 15 Oct 2015 18:27:14 +0000 (-0400) Subject: do tmp dir cleanup in error case too X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~326^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3879f6e6beb9f66bb071b65577b0f60fb91907c5;p=git-annex.git do tmp dir cleanup in error case too --- diff --git a/Annex/Direct.hs b/Annex/Direct.hs index eb8d4842d5..495ff5e75f 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.