summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'