diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-17 15:11:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-17 15:11:21 -0400 |
commit | 6668fe0ca201fb28311ca10300afc06136d38211 (patch) | |
tree | 76b01abe2e4227f0c2ad29f71b665cfe0194c1e6 /Annex | |
parent | bf1d81bd3ec7b4128d13ca04d2a90c8165d5ee2f (diff) |
update for DiffTree type change (which fixes assistant in subdir confusion bug)
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content/Direct.hs | 2 | ||||
-rw-r--r-- | Annex/Direct.hs | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index 3de6b12a3..b0b8621e9 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -101,7 +101,7 @@ addAssociatedFile key file = do else file':files {- Associated files are always stored relative to the top of the repository. - - The input FilePath is relative to the CWD. -} + - The input FilePath is relative to the CWD, or is absolute. -} normaliseAssociatedFile :: FilePath -> Annex FilePath normaliseAssociatedFile file = do top <- fromRepo Git.repoPath diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 96d3cdcc0..ea2b577b9 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -13,6 +13,7 @@ import qualified Git.LsFiles import qualified Git.Merge import qualified Git.DiffTree as DiffTree import Git.Sha +import Git.FilePath import Git.Types import Annex.CatFile import qualified Annex.Queue @@ -136,22 +137,22 @@ mergeDirect d branch g = do mergeDirectCleanup :: FilePath -> Git.Ref -> Git.Ref -> Annex () mergeDirectCleanup d oldsha newsha = do (items, cleanup) <- inRepo $ DiffTree.diffTreeRecursive oldsha newsha - forM_ items updated + makeabs <- flip fromTopFilePath <$> gitRepo + forM_ items (updated makeabs) void $ liftIO cleanup liftIO $ removeDirectoryRecursive d where - updated item = do + updated makeabs item = do + let f = makeabs (DiffTree.file item) void $ tryAnnex $ - go DiffTree.srcsha DiffTree.srcmode moveout moveout_raw + go f DiffTree.srcsha DiffTree.srcmode moveout moveout_raw void $ tryAnnex $ - go DiffTree.dstsha DiffTree.dstmode movein movein_raw + go f DiffTree.dstsha DiffTree.dstmode movein movein_raw where - go getsha getmode a araw + go f getsha getmode a araw | getsha item == nullSha = noop - | otherwise = - maybe (araw f) (\k -> void $ a k f) + | otherwise = maybe (araw f) (\k -> void $ a k f) =<< catKey (getsha item) (getmode item) - f = DiffTree.file item moveout = removeDirect |