mirror of
				https://github.com/Dev-Wiki/git-repo.git
				synced 2025-11-04 01:54:12 +08:00 
			
		
		
		
	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
This commit is contained in:
		@@ -217,9 +217,9 @@ class GitConfig(object):
 | 
			
		||||
    """Resolve any url.*.insteadof references.
 | 
			
		||||
    """
 | 
			
		||||
    for new_url in self.GetSubSections('url'):
 | 
			
		||||
      old_url = self.GetString('url.%s.insteadof' % new_url)
 | 
			
		||||
      if old_url is not None and url.startswith(old_url):
 | 
			
		||||
        return new_url + url[len(old_url):]
 | 
			
		||||
      for old_url in self.GetString('url.%s.insteadof' % new_url, True):
 | 
			
		||||
        if old_url is not None and url.startswith(old_url):
 | 
			
		||||
          return new_url + url[len(old_url):]
 | 
			
		||||
    return url
 | 
			
		||||
 | 
			
		||||
  @property
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user