Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- **core:** Fix scripts' calling parameters ([#5365](https://github.com/ScoopInstaller/Scoop/issues/5365))
- **core:** Fix `is_in_dir` under Unix ([#5391](https://github.com/ScoopInstaller/Scoop/issues/5391))
- **core:** Rewrite config file when needed ([#5439](https://github.com/ScoopInstaller/Scoop/issues/5439))
- **core:** Prevents leaking HTTP(S)_PROXY env vars to current sessions after Invoke-Git in parallel execution ([#5436](https://github.com/ScoopInstaller/Scoop/pull/5436))
- **env:** Avoid automatic expansion of `%%` in env ([#5395](https://github.com/ScoopInstaller/Scoop/issues/5395))
- **install:** Fix download from private GitHub repositories ([#5361](https://github.com/ScoopInstaller/Scoop/issues/5361))
- **scoop-info:** Fix errors in file size collection when `--verbose` ([#5352](https://github.com/ScoopInstaller/Scoop/pull/5352))
Expand Down
19 changes: 6 additions & 13 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,18 @@ function Invoke-Git {
}

if($ArgumentList -Match '\b(clone|checkout|pull|fetch|ls-remote)\b') {
$old_https = $env:HTTPS_PROXY
$old_http = $env:HTTP_PROXY
try {
$j = Start-Job -ScriptBlock {
# convert proxy setting for git
if ($proxy.StartsWith('currentuser@')) {
$proxy = $using:proxy
if ($proxy -and $proxy.StartsWith('currentuser@')) {
$proxy = $proxy.Replace('currentuser@', ':@')
}
$env:HTTPS_PROXY = $proxy
$env:HTTP_PROXY = $proxy
return & $git @ArgumentList
}
catch {
error $_
return
}
finally {
$env:HTTPS_PROXY = $old_https
$env:HTTP_PROXY = $old_http
& $using:git @using:ArgumentList
}
$o = $j | Receive-Job -Wait -AutoRemoveJob
return $o
}

return & $git @ArgumentList
Expand Down