Let the Git wrapper replace cmd\gitk.cmd, too

In a push to polish Git for Windows more, we are moving away from
scripts toward proper binaries.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2015-03-28 15:06:22 +01:00
parent dc236cdb7a
commit f29507a758

View File

@@ -322,6 +322,30 @@ int main(void)
PathAppend(exe, L"bin\\git.exe");
}
}
else if (!wcscmp(basename, L"gitk.exe")) {
static WCHAR buffer[BUFSIZE];
if (!PathRemoveFileSpec(exepath)) {
fwprintf(stderr,
L"Invalid executable path: %s\n", exepath);
ExitProcess(1);
}
/* set the default exe module */
wcscpy(exe, exepath);
wcscpy(buffer, exepath);
PathAppend(exe, msystem_bin);
PathAppend(exe, L"wish.exe");
if (_waccess(exe, 0) != -1)
PathAppend(buffer, msystem_bin);
else {
wcscpy(exe, exepath);
PathAppend(exe, L"mingw\\bin\\wish.exe");
PathAppend(buffer, L"mingw\\bin");
}
PathAppend(buffer, L"gitk");
prefix_args = buffer;
prefix_args_len = wcslen(buffer);
}
if (needs_env_setup)
setup_environment(exepath);