This commit is contained in:
Joey Hess 2011-01-27 17:58:30 -04:00
parent 167523f09d
commit 4f9336bb60
5 changed files with 6 additions and 6 deletions

View file

@ -187,7 +187,7 @@ filterFiles l = do
let regexp = compile (toregex exclude) [] let regexp = compile (toregex exclude) []
return $ filter (notExcluded regexp) l' return $ filter (notExcluded regexp) l'
where where
notState f = not $ isPrefixOf stateDir f notState f = not $ stateDir `isPrefixOf` f
notExcluded r f = case match r f [] of notExcluded r f = case match r f [] of
Nothing -> True Nothing -> True
Just _ -> False Just _ -> False

View file

@ -323,7 +323,7 @@ configRemotes repo = map construct remotepairs
| otherwise = repoFromPath v | otherwise = repoFromPath v
-- git remotes can be written scp style -- [user@]host:dir -- git remotes can be written scp style -- [user@]host:dir
-- where dir is relative to the user's home directory. -- 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 scptourl v = "ssh://" ++ host ++ slash dir
where where
bits = split ":" v bits = split ":" v
@ -458,7 +458,7 @@ prop_idempotent_deencode s = s == decodeGitFile (encodeGitFile s)
-} -}
absDir :: String -> IO String absDir :: String -> IO String
absDir d absDir d
| isPrefixOf "/" d = expandt d | "/" `isPrefixOf` d = expandt d
| otherwise = do | otherwise = do
h <- myhomedir h <- myhomedir
return $ h ++ d return $ h ++ d

View file

@ -93,7 +93,7 @@ gitAnnexUnusedLog r = gitAnnexDir r </> "unused"
{- Checks a symlink target to see if it appears to point to annexed content. -} {- Checks a symlink target to see if it appears to point to annexed content. -}
isLinkToAnnex :: FilePath -> Bool isLinkToAnnex :: FilePath -> Bool
isLinkToAnnex s = isInfixOf ("/" ++ objectDir) s isLinkToAnnex s = ("/" ++ objectDir) `isInfixOf` s
{- Converts a key into a filename fragment. {- Converts a key into a filename fragment.
- -

View file

@ -51,7 +51,7 @@ main' c@(cmd:dir:params)
main' c@(cmd:_) main' c@(cmd:_)
-- Handle the case of being the user's login shell. It will be passed -- Handle the case of being the user's login shell. It will be passed
-- a single string containing all the real parameters. -- 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 | elem cmd builtins = failure
| otherwise = external c | otherwise = external c

View file

@ -88,7 +88,7 @@ test_init = "git-annex init" ~: TestCase $ innewrepo $ do
e <- doesFileExist annexlog e <- doesFileExist annexlog
e @? (annexlog ++ " not created") e @? (annexlog ++ " not created")
c <- readFile annexlog c <- readFile annexlog
isInfixOf reponame c @? annexlog ++ " does not contain repo name" reponame `isInfixOf` c @? annexlog ++ " does not contain repo name"
where where
annexlog = ".git-annex/uuid.log" annexlog = ".git-annex/uuid.log"
reponame = "test repo" reponame = "test repo"