Skip to content

Commit 9cfc4ee

Browse files
committed
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 <[email protected]>
1 parent 0476977 commit 9cfc4ee

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

compat/win32/git-wrapper.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,30 @@ int main(void)
322322
PathAppend(exe, L"bin\\git.exe");
323323
}
324324
}
325+
else if (!wcscmp(basename, L"gitk.exe")) {
326+
static WCHAR buffer[BUFSIZE];
327+
if (!PathRemoveFileSpec(exepath)) {
328+
fwprintf(stderr,
329+
L"Invalid executable path: %s\n", exepath);
330+
ExitProcess(1);
331+
}
332+
333+
/* set the default exe module */
334+
wcscpy(exe, exepath);
335+
wcscpy(buffer, exepath);
336+
PathAppend(exe, msystem_bin);
337+
PathAppend(exe, L"wish.exe");
338+
if (_waccess(exe, 0) != -1)
339+
PathAppend(buffer, msystem_bin);
340+
else {
341+
wcscpy(exe, exepath);
342+
PathAppend(exe, L"mingw\\bin\\wish.exe");
343+
PathAppend(buffer, L"mingw\\bin");
344+
}
345+
PathAppend(buffer, L"gitk");
346+
prefix_args = buffer;
347+
prefix_args_len = wcslen(buffer);
348+
}
325349

326350
if (needs_env_setup)
327351
setup_environment(exepath);

0 commit comments

Comments
 (0)