Commit e135430
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 4d6cf6e commit e135430
1 file changed
Lines changed: 5 additions & 1 deletion
File tree
| 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