diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs index f9e98145a7..4c099ff3a4 100644 --- a/Utility/FileSystemEncoding.hs +++ b/Utility/FileSystemEncoding.hs @@ -43,6 +43,7 @@ import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.UTF8 as S8 import qualified Data.ByteString.Lazy.UTF8 as L8 #endif +import System.FilePath.ByteString (RawFilePath, encodeFilePath, decodeFilePath) import Utility.Exception import Utility.Split @@ -171,21 +172,11 @@ encodeBL' = L.pack . decodeW8 encodeBL' = L8.fromString #endif -{- Recent versions of the unix package have this alias; defined here - - for backwards compatibility. -} -type RawFilePath = S.ByteString - -{- Note that the RawFilePath is assumed to never contain NUL, - - since filename's don't. This should only be used with actual - - RawFilePaths not arbitrary ByteString that may contain NUL. -} fromRawFilePath :: RawFilePath -> FilePath -fromRawFilePath = decodeBS' +fromRawFilePath = decodeFilePath -{- Note that the FilePath is assumed to never contain NUL, - - since filename's don't. This should only be used with actual FilePaths - - not arbitrary String that may contain NUL. -} toRawFilePath :: FilePath -> RawFilePath -toRawFilePath = encodeBS' +toRawFilePath = encodeFilePath {- Converts a [Word8] to a FilePath, encoding using the filesystem encoding. - diff --git a/doc/todo/optimize_by_converting_String_to_ByteString.mdwn b/doc/todo/optimize_by_converting_String_to_ByteString.mdwn index 3cfab05107..9fcc9e5319 100644 --- a/doc/todo/optimize_by_converting_String_to_ByteString.mdwn +++ b/doc/todo/optimize_by_converting_String_to_ByteString.mdwn @@ -9,10 +9,7 @@ Benchmarking `git-annex find`, speedups range from 28-66%. The files fly by much more snappily. Other commands likely also speed up, but do more work than find so the improvement is not as large. -The `bs` branch is in a mergeable state now, except for: - -* filepath-bytestring probably has issues with utf16 filenames - on Windows. See its TODO. +The `bs` branch is in a mergeable state now. Stuff not entirely finished: diff --git a/git-annex.cabal b/git-annex.cabal index d18151368f..508781312e 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -320,7 +320,7 @@ Executable git-annex directory (>= 1.2), disk-free-space, filepath, - filepath-bytestring, + filepath-bytestring (>= 1.4.2.1.1), IfElse, hslogger, monad-logger, diff --git a/stack.yaml b/stack.yaml index dde1d76583..887fd68529 100644 --- a/stack.yaml +++ b/stack.yaml @@ -24,7 +24,7 @@ extra-deps: - sandi-0.5 - http-client-0.5.14 - silently-1.2.5.1 -- filepath-bytestring-1.4.2.1.0 +- filepath-bytestring-1.4.2.1.1 explicit-setup-deps: git-annex: true resolver: lts-13.29