aboutsummaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-27 16:21:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-27 16:21:56 -0400
commit1273fa91dbb822980792de8b29826fc5d6882791 (patch)
tree9c89ccc0f633589407a5fb3dbd22204ecff5ba3b /Git/Config.hs
parentaa4c032fad0cdd05eb43f3bde72a0d1071367da7 (diff)
blind enabling gcrypt repos on rsync.net
This pulls off quite a nice trick: When given a path on rsync.net, it determines if it is an encrypted git repository that the user has the key to decrypt, and merges with it. This is works even when the local repository had no idea that the gcrypt remote exists! (As previously done with local drives.) This commit sponsored by Pedro CĂ´rte-Real
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"
+ ]