From 780a379ab1e9ef88b855525c66070651159f1f5d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Feb 2025 13:49:17 -0400 Subject: [PATCH] remove unused functions from Utility.RawFilePath --- Annex/Ssh.hs | 1 - Git/Construct.hs | 3 +-- Utility/RawFilePath.hs | 25 ------------------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index b1184ccc14..07519d0390 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -39,7 +39,6 @@ import Annex.Concurrent.Utility import Types.Concurrency import Git.Env import Git.Ssh -import qualified Utility.RawFilePath as R import qualified Utility.OsString as OS import Annex.Perms #ifndef mingw32_HOST_OS diff --git a/Git/Construct.hs b/Git/Construct.hs index 229af82aff..3d503a5ebc 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -40,13 +40,12 @@ import Git.FilePath import qualified Git.Url as Url import Utility.UserInfo import Utility.Url.Parse -import qualified Utility.RawFilePath as R import qualified Utility.OsString as OS {- Finds the git repository used for the cwd, which may be in a parent - directory. -} fromCwd :: IO (Maybe Repo) -fromCwd = R.getCurrentDirectory >>= seekUp . toOsPath +fromCwd = getCurrentDirectory >>= seekUp where seekUp dir = do r <- checkForRepo dir diff --git a/Utility/RawFilePath.hs b/Utility/RawFilePath.hs index f07a39f6c4..e10f05d703 100644 --- a/Utility/RawFilePath.hs +++ b/Utility/RawFilePath.hs @@ -22,12 +22,8 @@ module Utility.RawFilePath ( readSymbolicLink, createSymbolicLink, createLink, - removeLink, getFileStatus, getSymbolicLinkStatus, - doesPathExist, - getCurrentDirectory, - createDirectory, setFileMode, setOwnerAndGroup, rename, @@ -38,18 +34,6 @@ module Utility.RawFilePath ( #ifndef mingw32_HOST_OS import Utility.FileSystemEncoding (RawFilePath) import System.Posix.Files.ByteString -import qualified System.Posix.Directory.ByteString as D - --- | Checks if a file or directory exists. Note that a dangling symlink --- will be false. -doesPathExist :: RawFilePath -> IO Bool -doesPathExist = fileExist - -getCurrentDirectory :: IO RawFilePath -getCurrentDirectory = D.getWorkingDirectory - -createDirectory :: RawFilePath -> IO () -createDirectory p = D.createDirectory p 0o777 #else import System.PosixCompat (FileStatus, FileMode) @@ -89,15 +73,6 @@ getSymbolicLinkStatus :: RawFilePath -> IO FileStatus getSymbolicLinkStatus p = P.getSymbolicLinkStatus . fromRawFilePath =<< convertToWindowsNativeNamespace p -doesPathExist :: RawFilePath -> IO Bool -doesPathExist = D.doesPathExist . fromRawFilePath - -getCurrentDirectory :: IO RawFilePath -getCurrentDirectory = toRawFilePath <$> D.getCurrentDirectory - -createDirectory :: RawFilePath -> IO () -createDirectory = D.createDirectory . fromRawFilePath - setFileMode :: RawFilePath -> FileMode -> IO () setFileMode p m = do p' <- fromRawFilePath <$> convertToWindowsNativeNamespace p