diff --git a/Annex/Common.hs b/Annex/Common.hs index fc0a25b1d0..13174c0b37 100644 --- a/Annex/Common.hs +++ b/Annex/Common.hs @@ -10,7 +10,7 @@ import Annex as X (gitRepo, inRepo, fromRepo, calcRepo, calcRepo') import Annex.Locations as X import Annex.Debug as X (fastDebug, debug) import Messages as X -import Git.Filename as X +import Git.Quote as X #ifndef mingw32_HOST_OS import System.Posix.IO as X hiding (createPipe) #endif diff --git a/Annex/Export.hs b/Annex/Export.hs index 489d8984e0..60039ef3b9 100644 --- a/Annex/Export.hs +++ b/Annex/Export.hs @@ -15,7 +15,7 @@ import Types import Types.Key import qualified Git import qualified Types.Remote as Remote -import Git.Filename +import Git.Quote import Messages import Data.Maybe diff --git a/Annex/LockPool/PosixOrPid.hs b/Annex/LockPool/PosixOrPid.hs index c7d7596ed8..04139687f8 100644 --- a/Annex/LockPool/PosixOrPid.hs +++ b/Annex/LockPool/PosixOrPid.hs @@ -32,7 +32,7 @@ import Utility.LockPool.STM (LockFile, LockMode(..)) import Utility.LockFile.LockStatus import Config (pidLockFile) import Messages (warning) -import Git.Filename +import Git.Quote import System.Posix diff --git a/Git/DiffTree.hs b/Git/DiffTree.hs index 3be5cb980a..102658922b 100644 --- a/Git/DiffTree.hs +++ b/Git/DiffTree.hs @@ -29,7 +29,7 @@ import Git.Sha import Git.Command import Git.FilePath import Git.DiffTreeItem -import qualified Git.Filename +import qualified Git.Quote import qualified Git.Ref import Utility.Attoparsec @@ -133,6 +133,6 @@ parserDiffRaw f = DiffTreeItem <*> (maybe (fail "bad dstsha") return . extractSha =<< nextword) <* A8.char ' ' <*> A.takeByteString - <*> pure (asTopFilePath $ fromInternalGitPath $ Git.Filename.unquote f) + <*> pure (asTopFilePath $ fromInternalGitPath $ Git.Quote.unquote f) where nextword = A8.takeTill (== ' ') diff --git a/Git/FilePath.hs b/Git/FilePath.hs index 37b046fc3f..fde7485930 100644 --- a/Git/FilePath.hs +++ b/Git/FilePath.hs @@ -30,7 +30,7 @@ module Git.FilePath ( import Common import Git -import Git.Filename +import Git.Quote import qualified System.FilePath.ByteString as P import qualified System.FilePath.Posix.ByteString diff --git a/Git/LsTree.hs b/Git/LsTree.hs index addd5b1069..9129d18fc4 100644 --- a/Git/LsTree.hs +++ b/Git/LsTree.hs @@ -23,7 +23,7 @@ import Common import Git import Git.Command import Git.FilePath -import qualified Git.Filename +import qualified Git.Quote import Utility.Attoparsec import Numeric @@ -137,7 +137,7 @@ parserLsTree long = case long of -- sha <*> (Ref <$> A8.takeTill A8.isSpace) - fileparser = asTopFilePath . Git.Filename.unquote <$> A.takeByteString + fileparser = asTopFilePath . Git.Quote.unquote <$> A.takeByteString sizeparser = fmap Just A8.decimal diff --git a/Git/Filename.hs b/Git/Quote.hs similarity index 99% rename from Git/Filename.hs rename to Git/Quote.hs index 2baea62dc6..2ca442ecb6 100644 --- a/Git/Filename.hs +++ b/Git/Quote.hs @@ -8,7 +8,7 @@ {-# LANGUAGE OverloadedStrings, TypeSynonymInstances #-} -module Git.Filename ( +module Git.Quote ( unquote, quote, noquote, diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs index a35474781d..41b62a8847 100644 --- a/Logs/Transfer.hs +++ b/Logs/Transfer.hs @@ -14,7 +14,7 @@ import Types.Transfer import Types.ActionItem import Annex.Common import qualified Git -import qualified Git.Filename +import qualified Git.Quote import Utility.Metered import Utility.Percentage import Utility.PID @@ -32,7 +32,7 @@ import Control.Concurrent.STM import qualified Data.ByteString.Char8 as B8 import qualified System.FilePath.ByteString as P -describeTransfer :: Git.Filename.QuotePath -> Transfer -> TransferInfo -> String +describeTransfer :: Git.Quote.QuotePath -> Transfer -> TransferInfo -> String describeTransfer qp t info = unwords [ show $ transferDirection t , show $ transferUUID t diff --git a/Messages.hs b/Messages.hs index c8395ff4c7..565822365c 100644 --- a/Messages.hs +++ b/Messages.hs @@ -69,7 +69,7 @@ import Messages.Concurrent import Annex.Debug import Annex.Concurrent.Utility import Utility.SafeOutput -import Git.Filename +import Git.Quote import qualified Messages.JSON as JSON import qualified Annex diff --git a/Messages/Internal.hs b/Messages/Internal.hs index 0b975cf74c..a16c7d2c61 100644 --- a/Messages/Internal.hs +++ b/Messages/Internal.hs @@ -13,7 +13,7 @@ import Types.Messages import Messages.Concurrent import qualified Messages.JSON as JSON import Messages.JSON (JSONBuilder) -import Git.Filename +import Git.Quote import Types.GitConfig import qualified Data.ByteString as S diff --git a/Messages/Serialized.hs b/Messages/Serialized.hs index 2e8ed00d5f..494df5aac5 100644 --- a/Messages/Serialized.hs +++ b/Messages/Serialized.hs @@ -21,7 +21,7 @@ import Messages.Internal import Messages.Progress import qualified Messages.JSON as JSON import Utility.Metered (BytesProcessed, setMeterTotalSize) -import Git.Filename +import Git.Quote import Control.Monad.IO.Class (MonadIO) diff --git a/Test.hs b/Test.hs index 237eba82b9..a9c7336a70 100644 --- a/Test.hs +++ b/Test.hs @@ -30,7 +30,7 @@ import qualified Utility.RawFilePath as R import qualified Utility.ShellEscape import qualified Annex -import qualified Git.Filename +import qualified Git.Quote import qualified Git.Types import qualified Git.Ref import qualified Git.LsTree @@ -151,7 +151,7 @@ tests n crippledfilesystem adjustedbranchok opts = properties :: TestTree properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck" $ - [ testProperty "prop_quote_unquote_roundtrip" Git.Filename.prop_quote_unquote_roundtrip + [ testProperty "prop_quote_unquote_roundtrip" Git.Quote.prop_quote_unquote_roundtrip , testProperty "prop_encode_c_decode_c_roundtrip" Utility.Format.prop_encode_c_decode_c_roundtrip , testProperty "prop_isomorphic_key_encode" Key.prop_isomorphic_key_encode , testProperty "prop_isomorphic_shellEscape" Utility.ShellEscape.prop_isomorphic_shellEscape diff --git a/Types/ActionItem.hs b/Types/ActionItem.hs index deca2ad137..373d786143 100644 --- a/Types/ActionItem.hs +++ b/Types/ActionItem.hs @@ -15,7 +15,7 @@ module Types.ActionItem ( import Key import Types.Transfer import Git.FilePath -import Git.Filename (StringContainingQuotedPath(..)) +import Git.Quote (StringContainingQuotedPath(..)) import Utility.FileSystemEncoding data ActionItem diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index e71e22d4a3..ea7388368b 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -32,7 +32,7 @@ import Git.Types import Git.ConfigTypes import Git.Remote (isRemoteKey, remoteKeyToRemoteName) import Git.Branch (CommitMode(..)) -import Git.Filename (QuotePath(..)) +import Git.Quote (QuotePath(..)) import Utility.DataUnits import Config.Cost import Types.UUID diff --git a/git-annex.cabal b/git-annex.cabal index c11047d2da..af7eecfadf 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -856,7 +856,6 @@ Executable git-annex Git.Env Git.FileMode Git.FilePath - Git.Filename Git.FilterProcess Git.Fsck Git.GCrypt @@ -871,6 +870,7 @@ Executable git-annex Git.Objects Git.PktLine Git.Queue + Git.Quote Git.Ref Git.RefLog Git.Remote