diff --git a/P2P/Protocol.hs b/P2P/Protocol.hs index 1c998ae70c..a75a6e6b1a 100644 --- a/P2P/Protocol.hs +++ b/P2P/Protocol.hs @@ -32,9 +32,10 @@ import Control.Monad import Control.Monad.Free import Control.Monad.Free.TH import Control.Monad.Catch -import System.FilePath import System.Exit (ExitCode(..)) import System.IO +import qualified System.FilePath.ByteString as P +import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L import Data.Char import Control.Applicative @@ -179,11 +180,11 @@ instance Proto.Serializable ProtoAssociatedFile where | isSpace c = "%" | otherwise = [c] - deserialize s = case fromRawFilePath $ fromInternalGitPath $ toRawFilePath $ deesc [] s of - [] -> Just $ ProtoAssociatedFile $ AssociatedFile Nothing + deserialize s = case fromInternalGitPath $ toRawFilePath $ deesc [] s of f - | isRelative f -> Just $ ProtoAssociatedFile $ - AssociatedFile $ Just $ toRawFilePath f + | B.null f -> Just $ ProtoAssociatedFile $ AssociatedFile Nothing + | P.isRelative f -> Just $ ProtoAssociatedFile $ + AssociatedFile $ Just f | otherwise -> Nothing where deesc b [] = reverse b diff --git a/Utility/SystemDirectory.hs b/Utility/SystemDirectory.hs index b9040fe13f..a7d60f931e 100644 --- a/Utility/SystemDirectory.hs +++ b/Utility/SystemDirectory.hs @@ -1,4 +1,4 @@ -{- System.Directory without its conflicting isSymbolicLink +{- System.Directory without its conflicting isSymbolicLink and getFileSize. - - Copyright 2016 Joey Hess -