diff options
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Lock.hs | 7 | ||||
-rw-r--r-- | Command/Smudge.hs | 3 | ||||
-rw-r--r-- | Command/Unannex.hs | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/Command/Lock.hs b/Command/Lock.hs index e4039dd8b..8b36e1cee 100644 --- a/Command/Lock.hs +++ b/Command/Lock.hs @@ -21,6 +21,7 @@ import Utility.InodeCache import qualified Database.Keys import Annex.Ingest import Logs.Location +import Git.FilePath cmd :: Command cmd = notDirect $ withGlobalOptions annexedMatchingOptions $ @@ -85,7 +86,9 @@ performNew file key filemodified = do -- Try to repopulate obj from an unmodified associated file. repopulate obj | filemodified = modifyContent obj $ do - fs <- Database.Keys.getAssociatedFiles key + g <- Annex.gitRepo + fs <- mapM (`fromTopFilePath` g) + <$> Database.Keys.getAssociatedFiles key mfile <- firstM (isUnmodified key) fs liftIO $ nukeFile obj case mfile of @@ -99,7 +102,7 @@ performNew file key filemodified = do cleanupNew :: FilePath -> Key -> CommandCleanup cleanupNew file key = do - Database.Keys.removeAssociatedFile key file + Database.Keys.removeAssociatedFile key =<< inRepo (toTopFilePath file) return True startOld :: FilePath -> CommandStart diff --git a/Command/Smudge.hs b/Command/Smudge.hs index 43033ee15..8b7d848d2 100644 --- a/Command/Smudge.hs +++ b/Command/Smudge.hs @@ -15,6 +15,7 @@ import Annex.FileMatcher import Annex.Ingest import Logs.Location import qualified Database.Keys +import Git.FilePath import qualified Data.ByteString.Lazy as B @@ -58,7 +59,7 @@ smudge file = do =<< catchMaybeIO (B.readFile content) , liftIO $ B.putStr b ) - Database.Keys.addAssociatedFile k file + Database.Keys.addAssociatedFile k =<< inRepo (toTopFilePath file) stop -- Clean filter is fed file content on stdin, decides if a file diff --git a/Command/Unannex.hs b/Command/Unannex.hs index 9bde19106..317fd5856 100644 --- a/Command/Unannex.hs +++ b/Command/Unannex.hs @@ -23,6 +23,7 @@ import qualified Git.DiffTree as DiffTree import Utility.CopyFile import Command.PreCommit (lockPreCommitHook) import qualified Database.Keys +import Git.FilePath cmd :: Command cmd = withGlobalOptions annexedMatchingOptions $ @@ -87,7 +88,7 @@ performIndirect file key = do cleanupIndirect :: FilePath -> Key -> CommandCleanup cleanupIndirect file key = do - Database.Keys.removeAssociatedFile key file + Database.Keys.removeAssociatedFile key =<< inRepo (toTopFilePath file) src <- calcRepo $ gitAnnexLocation key ifM (Annex.getState Annex.fast) ( do |