From 070b1a03392ab3962eb43f60f32fde5c1b9b70d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Apr 2016 17:32:04 -0400 Subject: fix auto merge conflict resolution when doing out of tree merge for adjusted branch --- Annex/GitOverlay.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Annex/GitOverlay.hs') diff --git a/Annex/GitOverlay.hs b/Annex/GitOverlay.hs index b6b1398f4..4230ed4a4 100644 --- a/Annex/GitOverlay.hs +++ b/Annex/GitOverlay.hs @@ -21,14 +21,20 @@ withIndexFile f = withAltRepo (\g -> addGitEnv g "GIT_INDEX_FILE" f) (\g g' -> g' { gitEnv = gitEnv g }) -{- Runs an action using a different git work tree. -} +{- Runs an action using a different git work tree. + - + - Smudge and clean filters are disabled in this work tree. -} withWorkTree :: FilePath -> Annex a -> Annex a withWorkTree d = withAltRepo - (\g -> return $ g { location = modlocation (location g) }) - (\g g' -> g' { location = location g }) + (\g -> return $ g { location = modlocation (location g), gitGlobalOpts = gitGlobalOpts g ++ disableSmudgeConfig }) + (\g g' -> g' { location = location g, gitGlobalOpts = gitGlobalOpts g }) where modlocation l@(Local {}) = l { worktree = Just d } modlocation _ = error "withWorkTree of non-local git repo" + disableSmudgeConfig = map Param + [ "-c", "filter.annex.smudge=" + , "-c", "filter.annex.clean=" + ] {- Runs an action with the git index file and HEAD, and a few other - files that are related to the work tree coming from an overlay -- cgit v1.2.3