diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-14 11:48:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-14 11:48:10 -0400 |
commit | 8c87293b4886bd7b3389c3a3066e2c6cfa9f1a56 (patch) | |
tree | 9a3ad67970177409808039926c4910360c038956 /Git | |
parent | 92a4af8b2019de2fac6df9c1e92e3858fe644639 (diff) |
avoid unnecessary stats when traversing to parent
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Construct.hs | 8 |
1 files 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 |