aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/Content/Direct.hs2
-rw-r--r--Annex/Direct.hs17
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/direct_mode_assistant_in_subdir_confusion.mdwn3
4 files changed, 16 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
diff --git a/debian/changelog b/debian/changelog
index 1a7b5f1ab..e124c71d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,9 @@ git-annex (4.20131003) UNRELEASED; urgency=low
* sync: Fix automatic resolution of merge conflicts where one side is an
annexed file, and the other side is a non-annexed file, or a directory.
* S3: Try to ensure bucket name is valid for archive.org.
+ * assistant: Bug fix: When run in a subdirectory, files from incoming merges
+ were wrongly added to that subdirectory, and removed from their original
+ locations.
-- Joey Hess <joeyh@debian.org> Thu, 03 Oct 2013 15:41:24 -0400
diff --git a/doc/bugs/direct_mode_assistant_in_subdir_confusion.mdwn b/doc/bugs/direct_mode_assistant_in_subdir_confusion.mdwn
index 6fe690a06..a705e434f 100644
--- a/doc/bugs/direct_mode_assistant_in_subdir_confusion.mdwn
+++ b/doc/bugs/direct_mode_assistant_in_subdir_confusion.mdwn
@@ -32,3 +32,6 @@ tree, which its code actually assumes is the case.
The assistant, however, does not do that, and it's useful in general to
only run it in a subdir.
+
+> Made sync merge code handle this correctly. Conflicted merge handing code
+> was already ok. [[fixed|done]] --[[Joey]]