From 7b92ffc3a1a8379bb5aed42b46797ebeabb6437e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 May 2013 15:43:23 -0400 Subject: [PATCH] more leaning toothpick fixes --- Git/Construct.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Git/Construct.hs b/Git/Construct.hs index a300715853..1cded7a136 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -58,7 +58,7 @@ fromPath dir = fromAbsPath =<< absPath dir - specified. -} fromAbsPath :: FilePath -> IO Repo fromAbsPath dir - | "/" `isPrefixOf` dir = + | isAbsolute dir = ifM (doesDirectoryExist dir') ( ret dir' , hunt ) | otherwise = error $ "internal error, " ++ dir ++ " is not absolute" @@ -71,7 +71,7 @@ fromAbsPath dir {- When dir == "foo/.git", git looks for "foo/.git/.git", - and failing that, uses "foo" as the repository. -} hunt - | "/.git" `isSuffixOf` canondir = + | pathSeparator:".git" `isSuffixOf` canondir = ifM (doesDirectoryExist $ dir ".git") ( ret dir , ret $ takeDirectory canondir