File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,25 +155,18 @@ function Invoke-Git {
155155 }
156156
157157 if ($ArgumentList -Match ' \b(clone|checkout|pull|fetch|ls-remote)\b' ) {
158- $old_https = $env: HTTPS_PROXY
159- $old_http = $env: HTTP_PROXY
160- try {
158+ $j = Start-Job - ScriptBlock {
161159 # convert proxy setting for git
162- if ($proxy.StartsWith (' currentuser@' )) {
160+ $proxy = $using :proxy
161+ if ($proxy -and $proxy.StartsWith (' currentuser@' )) {
163162 $proxy = $proxy.Replace (' currentuser@' , ' :@' )
164163 }
165164 $env: HTTPS_PROXY = $proxy
166165 $env: HTTP_PROXY = $proxy
167- return & $git @ArgumentList
168- }
169- catch {
170- error $_
171- return
172- }
173- finally {
174- $env: HTTPS_PROXY = $old_https
175- $env: HTTP_PROXY = $old_http
166+ & $using :git @using :ArgumentList
176167 }
168+ $o = $j | Receive-Job - Wait - AutoRemoveJob
169+ return $o
177170 }
178171
179172 return & $git @ArgumentList
You can’t perform that action at this time.
0 commit comments