aboutsummaryrefslogtreecommitdiff
path: root/Git/Types.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-30 14:07:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-30 14:07:46 -0400
commit5287d1dc3f293b6eb7f6759fe9f25be1ad85fbae (patch)
treea1b88f731331bbff60edd207403e56bd1ea87cc7 /Git/Types.hs
parent3dffcf9ccb4eebba48e904b9fb5bfe5d8446b761 (diff)
fixed behavior when multiple insteadOf configs are provided for the same url base
Consider this git config --list case: url.git+ssh://git@example.com/.insteadOf=gl url.git+ssh://git@example.com/.insteadOf=shared Since config is stored in a Map, only the last of the values for this key was stored and available for use by the insteadOf code. But that is wrong; git allows either "gl" or "shared" to be used in an url and the insteadOf value to be substituted in. To support this, it seems best to keep the existing config map as-is, and add a second map that accumulates a list of multiple values for config keys. This new fullconfig map can be used in the rare places where multiple values for a key make sense, without needing to complicate everything else. Haskell's laziness and data sharing keep the overhead of adding this second map low.
Diffstat (limited to 'Git/Types.hs')
-rw-r--r--Git/Types.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Git/Types.hs b/Git/Types.hs
index 250da5f5e..6063ad213 100644
--- a/Git/Types.hs
+++ b/Git/Types.hs
@@ -18,6 +18,8 @@ data RepoLocation = Dir FilePath | Url URI | Unknown
data Repo = Repo {
location :: RepoLocation,
config :: M.Map String String,
+ -- a given git config key can actually have multiple values
+ fullconfig :: M.Map String [String],
remotes :: [Repo],
-- remoteName holds the name used for this repo in remotes
remoteName :: Maybe String