You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, when being called via TortoiseGit the standard handles,
or at least what is returned by _get_osfhandle(0) for standard input,
can take on the value (HANDLE)-2 (which is not a legal value, according
to the documentation).
Even if this value is not documented anywhere, CreateProcess() works
without complaints if hStdInput set to this value.
In contrast, when our new code to restrict which file handles get
inherited by spawned processes apparently uses such a value in its
handle list, it does *not* work, erroring out with
`ERROR_INVALID_PARAMETER`.
To help this, special-case the value (HANDLE)-2 returned by
_get_osfhandle() and replace it with INVALID_HANDLE_VALUE, which will
hopefully let the handle inheritance restriction work even when called
from TortoiseGit.
This addresses git-for-windows#1481
Signed-off-by: Johannes Schindelin <[email protected]>
0 commit comments