From 8c87293b4886bd7b3389c3a3066e2c6cfa9f1a56 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 14 Jan 2012 11:48:10 -0400 Subject: avoid unnecessary stats when traversing to parent --- Git/Construct.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Git/Construct.hs b/Git/Construct.hs index fdc56a20a..bfb16164f 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -244,9 +244,11 @@ isRepoTop dir = do else isBareRepo where isRepo = gitSignature (".git" "config") - isBareRepo = (&&) - <$> doesDirectoryExist (dir "objects") - <*> gitSignature "config" + isBareRepo = do + e <- doesDirectoryExist (dir "objects") + if not e + then return e + else gitSignature "config" gitSignature file = doesFileExist (dir file) newFrom :: RepoLocation -> IO Repo -- cgit v1.2.3