forked from forgejo/forgejo
- Backport #22771
- Use the proxy (if one is specified) for pull mirrors syncs.
- Pulled the code from
c2774d9e80/modules/git/repo.go (L164-L170)
- Downstream issue: https://codeberg.org/forgejo/forgejo/issues/302
---------
Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
77c89572e9
commit
8fa419c4c1
3 changed files with 20 additions and 4 deletions
|
@ -164,10 +164,8 @@ func CloneWithArgs(ctx context.Context, args []CmdArg, from, to string, opts Clo
|
|||
|
||||
envs := os.Environ()
|
||||
u, err := url.Parse(from)
|
||||
if err == nil && (strings.EqualFold(u.Scheme, "http") || strings.EqualFold(u.Scheme, "https")) {
|
||||
if proxy.Match(u.Host) {
|
||||
envs = append(envs, fmt.Sprintf("https_proxy=%s", proxy.GetProxyURL()))
|
||||
}
|
||||
if err == nil {
|
||||
envs = proxy.EnvWithProxy(u)
|
||||
}
|
||||
|
||||
stderr := new(bytes.Buffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue