summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@nvidia.com>2013-10-28 22:28:42 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2014-03-06 21:04:18 -0800
commit4e4d40f7c07ffe4f8988ee5c225bc897bfcf2206 (patch)
tree14eb2da6ae555d0eea05e5d9797f16730f537661 /git_config.py
parent093fdb6587bba081c4d34eb9ea500149b1090280 (diff)
downloadgit-repo-4e4d40f7c07ffe4f8988ee5c225bc897bfcf2206.tar.gz
Fix UrlInsteadOf to handle multiple strings
For complex .gitconfig url rewrites, multiple insteadOf lines may be used for a url. Search all of them for the right rewrite. Change-Id: If5e9ecd054e86226924b0baf513801cd57c389cd
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/git_config.py b/git_config.py
index 32879ec7..c1a6b55e 100644
--- a/git_config.py
+++ b/git_config.py
@@ -217,9 +217,9 @@ class GitConfig(object):
217 """Resolve any url.*.insteadof references. 217 """Resolve any url.*.insteadof references.
218 """ 218 """
219 for new_url in self.GetSubSections('url'): 219 for new_url in self.GetSubSections('url'):
220 old_url = self.GetString('url.%s.insteadof' % new_url) 220 for old_url in self.GetString('url.%s.insteadof' % new_url, True):
221 if old_url is not None and url.startswith(old_url): 221 if old_url is not None and url.startswith(old_url):
222 return new_url + url[len(old_url):] 222 return new_url + url[len(old_url):]
223 return url 223 return url
224 224
225 @property 225 @property