aboutsummaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-08 13:15:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-08 13:15:35 -0400
commitfb4b19deedca3f7bebfc415b1c9bc44f0e125567 (patch)
treec4e80468c5038a0ec13f57fd7196596d71441e1a /Git/Config.hs
parent7e2d07484f2ae9912f34e30e8b5614fb86099eed (diff)
make the webapp honor the web.browser git config
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index c82d6bb1b..0a720c1c0 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -54,6 +54,16 @@ read' repo = go repo
params = ["config", "--null", "--list"]
p = (proc "git" params) { cwd = Just d }
+{- Gets the global git config, returning a dummy Repo containing it. -}
+global :: IO Repo
+global = do
+ repo <- Git.Construct.fromUnknown
+ withHandle StdoutHandle createProcessSuccess p $
+ hRead repo
+ where
+ params = ["config", "--null", "--list", "--global"]
+ p = (proc "git" params)
+
{- Reads git config from a handle and populates a repo with it. -}
hRead :: Repo -> Handle -> IO Repo
hRead repo h = do