summaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index 513c3e5a6..db795b7a7 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -168,3 +168,12 @@ fromPipe r cmd params = try $
where
p = proc cmd $ toCommand params
+{- Reads git config from a specified file and returns the repo populated
+ - with the configuration. -}
+fromFile :: Repo -> FilePath -> IO (Either SomeException (Repo, String))
+fromFile r f = fromPipe r "git"
+ [ Param "config"
+ , Param "--file"
+ , File f
+ , Param "--list"
+ ]