From f09e299156fa01e4591fa3695c4f2bc827fe3db0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Feb 2023 15:02:53 -0400 Subject: [PATCH] rawfilepath conversion --- Annex/Branch.hs | 2 +- Annex/Link.hs | 2 +- Assistant/Threads/Watcher.hs | 2 +- Command/Add.hs | 2 +- Git/Repair.hs | 2 +- Git/UpdateIndex.hs | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Annex/Branch.hs b/Annex/Branch.hs index b227adb32c..7f03f6bece 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -844,7 +844,7 @@ performTransitionsLocked jl ts neednewlocalbranch transitionedrefs = do if L.null content' then do Annex.Queue.addUpdateIndex - =<< inRepo (Git.UpdateIndex.unstageFile (fromRawFilePath file)) + =<< inRepo (Git.UpdateIndex.unstageFile file) -- File is deleted; can't run any other -- transitions on it. return () diff --git a/Annex/Link.hs b/Annex/Link.hs index 1a344d07ef..ad2ce15478 100644 --- a/Annex/Link.hs +++ b/Annex/Link.hs @@ -138,7 +138,7 @@ hashPointerFile key = hashBlob $ formatPointer key stagePointerFile :: RawFilePath -> Maybe FileMode -> Sha -> Annex () stagePointerFile file mode sha = Annex.Queue.addUpdateIndex =<< - inRepo (Git.UpdateIndex.stageFile sha treeitemtype $ fromRawFilePath file) + inRepo (Git.UpdateIndex.stageFile sha treeitemtype file) where treeitemtype | maybe False isExecutable mode = TreeExecutable diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs index 8a668f0db3..bbc4fa31c5 100644 --- a/Assistant/Threads/Watcher.hs +++ b/Assistant/Threads/Watcher.hs @@ -341,7 +341,7 @@ onDel' file = do topfile <- inRepo (toTopFilePath (toRawFilePath file)) withkey $ flip Database.Keys.removeAssociatedFile topfile Annex.Queue.addUpdateIndex =<< - inRepo (Git.UpdateIndex.unstageFile file) + inRepo (Git.UpdateIndex.unstageFile (toRawFilePath file)) where withkey a = maybe noop a =<< catKeyFile (toRawFilePath file) diff --git a/Command/Add.hs b/Command/Add.hs index e1742bed66..20ec77ae82 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -182,7 +182,7 @@ addFile smallorlarge file s = do =<< withTSDelta (liftIO . genInodeCache file) Large -> noop Annex.Queue.addUpdateIndex =<< - inRepo (stageFile sha treetype (fromRawFilePath file)) + inRepo (stageFile sha treetype file) return True where changed a b = diff --git a/Git/Repair.hs b/Git/Repair.hs index 3b51ff1479..601b32291a 100644 --- a/Git/Repair.hs +++ b/Git/Repair.hs @@ -433,7 +433,7 @@ rewriteIndex r reinject (file, sha, mode, _) = case toTreeItemType mode of Nothing -> return Nothing Just treeitemtype -> Just <$> - UpdateIndex.stageFile sha treeitemtype (fromRawFilePath file) r + UpdateIndex.stageFile sha treeitemtype file r newtype GoodCommits = GoodCommits (S.Set Sha) diff --git a/Git/UpdateIndex.hs b/Git/UpdateIndex.hs index 0ac21617fb..f56bc86cbc 100644 --- a/Git/UpdateIndex.hs +++ b/Git/UpdateIndex.hs @@ -99,15 +99,15 @@ updateIndexLine sha treeitemtype file = L.fromStrict $ <> "\t" <> indexPath file -stageFile :: Sha -> TreeItemType -> FilePath -> Repo -> IO Streamer +stageFile :: Sha -> TreeItemType -> RawFilePath -> Repo -> IO Streamer stageFile sha treeitemtype file repo = do - p <- toTopFilePath (toRawFilePath file) repo + p <- toTopFilePath file repo return $ pureStreamer $ updateIndexLine sha treeitemtype p {- A streamer that removes a file from the index. -} -unstageFile :: FilePath -> Repo -> IO Streamer +unstageFile :: RawFilePath -> Repo -> IO Streamer unstageFile file repo = do - p <- toTopFilePath (toRawFilePath file) repo + p <- toTopFilePath file repo return $ unstageFile' p unstageFile' :: TopFilePath -> Streamer -- 2.30.2