aboutsummaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-10 19:14:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-10 19:14:32 -0400
commit93d2dc0d6878ccb1067376d2a03193c222429d3e (patch)
treef3b240db5892bf800c09a177e7d48d29576af20f /GitRepo.hs
parent586266e444f72808101a055323887fe08ae7fce3 (diff)
cache whether a repo is bare
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index 06da2ff88..ef76fb976 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -12,17 +12,19 @@ import Types
{- GitRepo constructor -}
gitRepo :: FilePath -> IO GitRepo
gitRepo dir = do
+ b <- isBareRepo dir
+
-- TOOD query repo for configuration settings; other repositories; etc
return GitRepo {
top = dir,
+ bare = b,
remotes = []
}
{- Path to a repository's gitattributes file. -}
gitAttributes :: GitRepo -> IO String
gitAttributes repo = do
- bare <- isBareRepo (top repo)
- if (bare)
+ if (bare repo)
then return $ (top repo) ++ "/info/.gitattributes"
else return $ (top repo) ++ "/.gitattributes"
@@ -31,8 +33,7 @@ gitAttributes repo = do
- TODO: support GIT_DIR -}
gitDir :: GitRepo -> IO String
gitDir repo = do
- bare <- isBareRepo (top repo)
- if (bare)
+ if (bare repo)
then return $ (top repo)
else return $ (top repo) ++ "/.git"