diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-05 17:22:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-05 17:22:19 -0400 |
commit | 903241502a6ad1a4845ac2d131ef7fc2b547400d (patch) | |
tree | fba85c9751a19aa0873e0f2bd837a1b000588508 /Annex/AutoMerge.hs | |
parent | cf911557bf4bb27768c4fc5ac482e8f827807497 (diff) |
use TopFilePath for associated files
Fixes several bugs with updates of pointer files. When eg, running
git annex drop --from localremote
it was updating the pointer file in the local repository, not the remote.
Also, fixes drop ../foo when run in a subdir, and probably lots of other
problems. Test suite drops from ~30 to 11 failures now.
TopFilePath is used to force thinking about what the filepath is relative
to.
The data stored in the sqlite db is still just a plain string, and
TopFilePath is a newtype, so there's no overhead involved in using it in
DataBase.Keys.
Diffstat (limited to 'Annex/AutoMerge.hs')
-rw-r--r-- | Annex/AutoMerge.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs index 462e87e09..162ea66bc 100644 --- a/Annex/AutoMerge.hs +++ b/Annex/AutoMerge.hs @@ -24,6 +24,7 @@ import qualified Git.Ref import qualified Git import qualified Git.Branch import Git.Types (BlobType(..)) +import Git.FilePath import Config import Annex.ReplaceFile import Annex.VariantFile @@ -188,7 +189,7 @@ resolveMerge' unstagedmap (Just us) them u = do writeFile dest (formatPointer key) _ -> noop stagePointerFile dest =<< hashPointerFile key - Database.Keys.addAssociatedFile key dest + Database.Keys.addAssociatedFile key =<< inRepo (toTopFilePath dest) {- Stage a graft of a directory or file from a branch. - |