summaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs22
1 files changed, 17 insertions, 5 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index c26f752ef..d01ba642b 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -1,6 +1,15 @@
{- git repository handling -}
-module GitRepo where
+module GitRepo (
+ GitRepo,
+ gitRepoCurrent,
+ gitRepoTop,
+ gitDir,
+ gitRelative,
+ gitConfigGet,
+ gitAdd,
+ gitAttributes
+) where
import Directory
import System.Directory
@@ -13,7 +22,7 @@ import Utility
-- a git repository
data GitRepo = GitRepo {
- top :: FilePath,
+ gitRepoTop :: FilePath,
bare :: Bool
}
@@ -23,10 +32,13 @@ gitRepo dir = do
b <- isBareRepo dir
return GitRepo {
- top = dir,
+ gitRepoTop = dir,
bare = b
}
+{- Short name used in here for top of repo. -}
+top = gitRepoTop
+
{- Path to a repository's gitattributes file. -}
gitAttributes :: GitRepo -> IO String
gitAttributes repo = do
@@ -73,8 +85,8 @@ gitConfigGet name defaultValue =
return ret
{- Finds the current git repository, which may be in a parent directory. -}
-currentRepo :: IO GitRepo
-currentRepo = do
+gitRepoCurrent :: IO GitRepo
+gitRepoCurrent = do
cwd <- getCurrentDirectory
top <- seekUp cwd isRepoTop
case top of