Skip to content

Commit

Permalink
Merge branch 'consolez'
Browse files Browse the repository at this point in the history
This fixes an issue where the Git wrapper would terminate upon Ctrl+C,
even in the case when its child process would *not* terminate.

Note: while the original intention was to fix running Git Bash in
ConsoleZ, the bug fix applies also to running

	C:\Program Files\Git\bin\bash -l -i

in a cmd window.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Mar 14, 2016
2 parents e075a46 + 6c8d129 commit f982dfe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion compat/win32/git-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,16 @@ int main(void)
working_directory, /* use parent's */
&si, &pi);
if (br) {
if (wait)
if (wait) {
/*
* Ignore Ctrl+C: the called process needs
* to handle this event correctly, then we
* quit, too.
*/
SetConsoleCtrlHandler(NULL, TRUE);
WaitForSingleObject(pi.hProcess, INFINITE);
SetConsoleCtrlHandler(NULL, FALSE);
}
if (!GetExitCodeProcess(pi.hProcess, (DWORD *)&r))
print_error(L"error reading exit code",
GetLastError());
Expand Down

0 comments on commit f982dfe

Please sign in to comment.