Inject git authentication string for specific git commands.
(s string)
| 142 | |
| 143 | // Inject git authentication string for specific git commands. |
| 144 | func addGitAuthentication(s string) string { |
| 145 | pattern := regexp.MustCompile(`( fetch | pull | push | clone | remote add.+-f | submodule )`) |
| 146 | loc := pattern.FindStringIndex(s) |
| 147 | if loc == nil { |
| 148 | return s |
| 149 | } |
| 150 | return s[:loc[0]+1] + gitAuthRE + s[loc[0]+1:] |
| 151 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…