idiom
This commit is contained in:
parent
167523f09d
commit
4f9336bb60
5 changed files with 6 additions and 6 deletions
|
@ -187,7 +187,7 @@ filterFiles l = do
|
|||
let regexp = compile (toregex exclude) []
|
||||
return $ filter (notExcluded regexp) l'
|
||||
where
|
||||
notState f = not $ isPrefixOf stateDir f
|
||||
notState f = not $ stateDir `isPrefixOf` f
|
||||
notExcluded r f = case match r f [] of
|
||||
Nothing -> True
|
||||
Just _ -> False
|
||||
|
|
|
@ -323,7 +323,7 @@ configRemotes repo = map construct remotepairs
|
|||
| otherwise = repoFromPath v
|
||||
-- git remotes can be written scp style -- [user@]host:dir
|
||||
-- where dir is relative to the user's home directory.
|
||||
scpstyle v = isInfixOf ":" v && (not $ isInfixOf "//" v)
|
||||
scpstyle v = ":" `isInfixOf` v && (not $ "//" `isInfixOf` v)
|
||||
scptourl v = "ssh://" ++ host ++ slash dir
|
||||
where
|
||||
bits = split ":" v
|
||||
|
@ -458,7 +458,7 @@ prop_idempotent_deencode s = s == decodeGitFile (encodeGitFile s)
|
|||
-}
|
||||
absDir :: String -> IO String
|
||||
absDir d
|
||||
| isPrefixOf "/" d = expandt d
|
||||
| "/" `isPrefixOf` d = expandt d
|
||||
| otherwise = do
|
||||
h <- myhomedir
|
||||
return $ h ++ d
|
||||
|
|
|
@ -93,7 +93,7 @@ gitAnnexUnusedLog r = gitAnnexDir r </> "unused"
|
|||
|
||||
{- Checks a symlink target to see if it appears to point to annexed content. -}
|
||||
isLinkToAnnex :: FilePath -> Bool
|
||||
isLinkToAnnex s = isInfixOf ("/" ++ objectDir) s
|
||||
isLinkToAnnex s = ("/" ++ objectDir) `isInfixOf` s
|
||||
|
||||
{- Converts a key into a filename fragment.
|
||||
-
|
||||
|
|
|
@ -51,7 +51,7 @@ main' c@(cmd:dir:params)
|
|||
main' c@(cmd:_)
|
||||
-- Handle the case of being the user's login shell. It will be passed
|
||||
-- a single string containing all the real parameters.
|
||||
| isPrefixOf "git-annex-shell " cmd = main' $ drop 1 $ shellUnEscape cmd
|
||||
| "git-annex-shell " `isPrefixOf` cmd = main' $ drop 1 $ shellUnEscape cmd
|
||||
| elem cmd builtins = failure
|
||||
| otherwise = external c
|
||||
|
||||
|
|
2
test.hs
2
test.hs
|
@ -88,7 +88,7 @@ test_init = "git-annex init" ~: TestCase $ innewrepo $ do
|
|||
e <- doesFileExist annexlog
|
||||
e @? (annexlog ++ " not created")
|
||||
c <- readFile annexlog
|
||||
isInfixOf reponame c @? annexlog ++ " does not contain repo name"
|
||||
reponame `isInfixOf` c @? annexlog ++ " does not contain repo name"
|
||||
where
|
||||
annexlog = ".git-annex/uuid.log"
|
||||
reponame = "test repo"
|
||||
|
|
Loading…
Reference in a new issue