summaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-16 14:57:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-16 14:57:58 -0400
commit6b3d7e6ef94a2b81cdf814aaf409acf4da7b0ac7 (patch)
tree9de5c804a753bce2fb241836235e2a3cf8073933 /Annex/Direct.hs
parenta40e203f23a87bbc6d362d33734f1e4dcf645871 (diff)
ensure merge directory is empty before starting merge
Don't want some past failed merge to lead to bad results, potentially.
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index ad9338ec7..96d3cdcc0 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -122,6 +122,8 @@ addDirect file cache = do
-}
mergeDirect :: FilePath -> Git.Ref -> Git.Repo -> IO Bool
mergeDirect d branch g = do
+ whenM (doesDirectoryExist d) $
+ removeDirectoryRecursive d
createDirectoryIfMissing True d
let g' = g { location = Local { gitdir = Git.localGitDir g, worktree = Just d } }
Git.Merge.mergeNonInteractive branch g'