summaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 17:18:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 17:18:12 -0400
commitbc620991aa586d6758e5ef997342899edc87bc4a (patch)
treeddaa6ba7ac21ba08d60603e1670f4c0be7e1948a /Annex/Direct.hs
parentab23d1549d615b42ce77545987b8efc59be9068f (diff)
direct mode merge relative path trickiness
This fixes 9 test suite failures. There are some tricky things going on with the paths to the index file, and git's working directory, which are hard to get right with relative paths. So, I switched back to absolute here, at least for now. Only 2 test suite failures remain on this branch, but there are other potential problems the test suite doesn't catch. Including some calls to setCurrentDirectory -- I was wrong and git-annex does do that in a few places, like when generating a view.
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index e4015dd16..15eb04060 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -160,8 +160,8 @@ addDirect file cache = do
-}
mergeDirect :: Maybe Git.Ref -> Maybe Git.Ref -> Git.Branch -> Annex Bool -> Git.Branch.CommitMode -> Annex Bool
mergeDirect startbranch oldref branch resolvemerge commitmode = exclusively $ do
- reali <- fromRepo indexFile
- tmpi <- fromRepo indexFileLock
+ reali <- liftIO . absPath =<< fromRepo indexFile
+ tmpi <- liftIO . absPath =<< fromRepo indexFileLock
liftIO $ copyFile reali tmpi
d <- fromRepo gitAnnexMergeDir
@@ -198,9 +198,12 @@ stageMerge d branch commitmode = do
merger <- ifM (coreSymlinks <$> Annex.getGitConfig)
( return Git.Merge.stageMerge
, return $ \ref -> Git.Merge.mergeNonInteractive ref commitmode
- )
- inRepo $ \g -> merger branch $
- g { location = Local { gitdir = Git.localGitDir g, worktree = Just d } }
+ )
+ inRepo $ \g -> do
+ wd <- liftIO $ absPath d
+ gd <- liftIO $ absPath $ Git.localGitDir g
+ merger branch $
+ g { location = Local { gitdir = gd, worktree = Just (addTrailingPathSeparator wd) } }
{- Commits after a direct mode merge is complete, and after the work
- tree has been updated by mergeDirectCleanup.