finished this stage of the RawFilePath conversion
Finally compiles again, and test suite passes. This commit was sponsored by Brock Spratlen on Patreon.
This commit is contained in:
parent
4bcb4030a5
commit
5a1e73617d
36 changed files with 188 additions and 147 deletions
|
@ -124,7 +124,8 @@ builtin cmd dir params = do
|
|||
"Restricted login shell for git-annex only SSH access"
|
||||
where
|
||||
mkrepo = do
|
||||
r <- Git.Construct.repoAbsPath dir >>= Git.Construct.fromAbsPath
|
||||
r <- Git.Construct.repoAbsPath (toRawFilePath dir)
|
||||
>>= Git.Construct.fromAbsPath
|
||||
Git.Config.read r
|
||||
`catchIO` \_ -> do
|
||||
hn <- fromMaybe "unknown" <$> getHostname
|
||||
|
|
|
@ -71,7 +71,7 @@ checkDirectory mdir = do
|
|||
canondir home d
|
||||
| "~/" `isPrefixOf` d = return d
|
||||
| "/~/" `isPrefixOf` d = return $ drop 1 d
|
||||
| otherwise = relHome $ fromRawFilePath <$> absPathFrom
|
||||
| otherwise = relHome $ fromRawFilePath $ absPathFrom
|
||||
(toRawFilePath home)
|
||||
(toRawFilePath d)
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import Utility.Tuple
|
|||
import Control.Concurrent.Async
|
||||
import System.Posix.Types
|
||||
import Data.IORef
|
||||
import qualified System.FilePath.ByteString as P
|
||||
|
||||
data AnnexedFileSeeker = AnnexedFileSeeker
|
||||
{ startAction :: SeekInput -> RawFilePath -> Key -> CommandStart
|
||||
|
@ -92,7 +93,7 @@ withFilesNotInGit (CheckGitIgnore ci) ww a l = do
|
|||
seekFiltered (const (pure True)) a $
|
||||
seekHelper id ww (const $ LsFiles.notInRepo [] include_ignored) l
|
||||
|
||||
withPathContents :: ((FilePath, FilePath) -> CommandSeek) -> CmdParams -> CommandSeek
|
||||
withPathContents :: ((RawFilePath, RawFilePath) -> CommandSeek) -> CmdParams -> CommandSeek
|
||||
withPathContents a params = do
|
||||
matcher <- Limit.getMatcher
|
||||
forM_ params $ \p -> do
|
||||
|
@ -102,13 +103,18 @@ withPathContents a params = do
|
|||
a f
|
||||
where
|
||||
get p = ifM (isDirectory <$> getFileStatus p)
|
||||
( map (\f -> (f, makeRelative (takeDirectory (dropTrailingPathSeparator p)) f))
|
||||
( map (\f ->
|
||||
let f' = toRawFilePath f
|
||||
in (f', P.makeRelative (P.takeDirectory (P.dropTrailingPathSeparator p')) f'))
|
||||
<$> dirContentsRecursiveSkipping (".git" `isSuffixOf`) True p
|
||||
, return [(p, takeFileName p)]
|
||||
, return [(p', P.takeFileName p')]
|
||||
)
|
||||
where
|
||||
p' = toRawFilePath p
|
||||
|
||||
checkmatch matcher (f, relf) = matcher $ MatchingFile $ FileInfo
|
||||
{ contentFile = Just (toRawFilePath f)
|
||||
, matchFile = toRawFilePath relf
|
||||
{ contentFile = Just f
|
||||
, matchFile = relf
|
||||
}
|
||||
|
||||
withWords :: ([String] -> CommandSeek) -> CmdParams -> CommandSeek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue