From 903241502a6ad1a4845ac2d131ef7fc2b547400d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Jan 2016 17:22:19 -0400 Subject: 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. --- Upgrade/V5.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Upgrade') diff --git a/Upgrade/V5.hs b/Upgrade/V5.hs index 8e567b425..369188fb8 100644 --- a/Upgrade/V5.hs +++ b/Upgrade/V5.hs @@ -20,6 +20,7 @@ import qualified Annex.Content.Direct as Direct import qualified Git import qualified Git.LsFiles import qualified Git.Branch +import Git.FilePath import Git.FileMode import Git.Config import Utility.InodeCache @@ -89,7 +90,8 @@ upgradeDirectWorkTree = do , fromdirect f k ) stagePointerFile f =<< hashPointerFile k - Database.Keys.addAssociatedFile k f + Database.Keys.addAssociatedFile k + =<< inRepo (toTopFilePath f) return () go _ = noop -- cgit v1.2.3