diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index 68ee9efc02..97cc04a0cb 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -33,6 +33,7 @@ import Annex.CurrentBranch import Annex.Content import Annex.InodeSentinal import qualified Database.Keys +import qualified Utility.RawFilePath as R withFilesInGit :: (RawFilePath -> CommandSeek) -> [WorkTreeItem] -> CommandSeek withFilesInGit a l = seekActions $ prepFiltered a $ @@ -276,4 +277,4 @@ workTreeItems' (AllowHidden allowhidden) ps = do | otherwise = return False notSymlink :: RawFilePath -> IO Bool -notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus (fromRawFilePath f) +notSymlink f = liftIO $ not . isSymbolicLink <$> R.getSymbolicLinkStatus f diff --git a/Command/Add.hs b/Command/Add.hs index 0ebe42d735..919d217505 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -19,6 +19,7 @@ import Annex.Link import Annex.Tmp import Messages.Progress import Git.FilePath +import qualified Utility.RawFilePath as R cmd :: Command cmd = notBareRepo $ @@ -92,7 +93,7 @@ start file = do maybe go fixuppointer mk where go = ifAnnexed file addpresent add - add = liftIO (catchMaybeIO $ getSymbolicLinkStatus (fromRawFilePath file)) >>= \case + add = liftIO (catchMaybeIO $ R.getSymbolicLinkStatus file) >>= \case Nothing -> stop Just s | not (isRegularFile s) && not (isSymbolicLink s) -> stop @@ -102,7 +103,7 @@ start file = do then next $ addFile file else perform file addpresent key = - liftIO (catchMaybeIO $ getSymbolicLinkStatus $ fromRawFilePath file) >>= \case + liftIO (catchMaybeIO $ R.getSymbolicLinkStatus file) >>= \case Just s | isSymbolicLink s -> fixuplink key _ -> add fixuplink key = starting "add" (ActionItemWorkTreeFile file) $ do diff --git a/Utility/RawFilePath.hs b/Utility/RawFilePath.hs index ff7057783f..a62ba65e51 100644 --- a/Utility/RawFilePath.hs +++ b/Utility/RawFilePath.hs @@ -18,6 +18,7 @@ module Utility.RawFilePath ( RawFilePath, readSymbolicLink, getFileStatus, + getSymbolicLinkStatus, ) where #ifndef mingw32_HOST_OS @@ -33,4 +34,7 @@ readSymbolicLink f = toRawFilePath <$> P.readSymbolicLink (fromRawFilePath f) getFileStatus :: RawFilePath -> IO FileStatus getFileStatus = P.getFileStatus . fromRawFilePath + +getSymbolicLinkStatus :: RawFilePath -> IO FileStatus +getSymbolicLinkStatus = P.getSymbolicLinkStatus . fromRawFilePath #endif