MCPcopy Create free account
hub / github.com/go-git/go-git / applyURLRules

Method applyURLRules

config/config.go:681–696  ·  view source on GitHub ↗
(urlRules map[string]*URL)

Source from the content-addressed store, hash-verified

679}
680
681func (c *RemoteConfig) applyURLRules(urlRules map[string]*URL) {
682 // save original urls
683 originalURLs := make([]string, len(c.URLs))
684 copy(originalURLs, c.URLs)
685
686 for i, url := range c.URLs {
687 if matchingURLRule := findLongestInsteadOfMatch(url, urlRules); matchingURLRule != nil {
688 c.URLs[i] = matchingURLRule.ApplyInsteadOf(c.URLs[i])
689 c.insteadOfRulesApplied = true
690 }
691 }
692
693 if c.insteadOfRulesApplied {
694 c.originalURLs = originalURLs
695 }
696}

Callers 1

unmarshalRemotesMethod · 0.95

Calls 2

ApplyInsteadOfMethod · 0.80

Tested by

no test coverage detected