do tmp dir cleanup in error case too
This commit is contained in:
parent
1b023493ef
commit
3879f6e6be
1 changed files with 4 additions and 5 deletions
|
@ -182,8 +182,9 @@ mergeDirect startbranch oldref branch resolvemerge commitmode = exclusively $ do
|
||||||
mergeDirectCommit merged startbranch branch commitmode
|
mergeDirectCommit merged startbranch branch commitmode
|
||||||
liftIO $ whenM (doesFileExist tmpi) $
|
liftIO $ whenM (doesFileExist tmpi) $
|
||||||
rename tmpi reali
|
rename tmpi reali
|
||||||
else liftIO $ nukeFile tmpi
|
else do
|
||||||
|
liftIO $ nukeFile tmpi
|
||||||
|
liftIO $ removeDirectoryRecursive d
|
||||||
return ok
|
return ok
|
||||||
where
|
where
|
||||||
exclusively = withExclusiveLock gitAnnexMergeLock
|
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
|
canff = maybe (return False) (\o -> inRepo $ Git.Branch.fastForwardable o branch) old
|
||||||
|
|
||||||
mergeDirectCleanup :: FilePath -> Git.Ref -> Annex ()
|
mergeDirectCleanup :: FilePath -> Git.Ref -> Annex ()
|
||||||
mergeDirectCleanup d oldref = do
|
mergeDirectCleanup d oldref = updateWorkTree d oldref False
|
||||||
updateWorkTree d oldref False
|
|
||||||
liftIO $ removeDirectoryRecursive d
|
|
||||||
|
|
||||||
{- Updates the direct mode work tree to reflect the changes staged in the
|
{- 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.
|
- index by a git command, that was run in a temporary work tree.
|
||||||
|
|
Loading…
Reference in a new issue