Commit 2b8f907
committed
git: fix crash when reading stderr from non-redirected processes
ProcessManager.CreateProcess sets RedirectStandardError=false for all
processes to avoid TRACE2 deadlocks. However, GetRemotes and
CreateGitException unconditionally read StandardError, which throws
InvalidOperationException when stderr is not redirected.
Fix GetRemotes by explicitly redirecting stderr before starting the
process, since it needs to check for 'not a git repository' errors.
Guard CreateGitException defensively, as it is called from various
contexts where stderr may or may not be redirected.
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>1 parent 9f04cd3 commit 2b8f907
File tree
1 file changed
+5
-1
lines changed1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
277 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
0 commit comments