Skip to content

Commit 2ac10bd

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 41c1e1f commit 2ac10bd

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
@@ -325,6 +325,30 @@ int main(void)
325325
PathAppend(exe, L"bin\\git.exe");
326326
}
327327
}
328+
else if (!wcscmp(basename, L"gitk.exe")) {
329+
static WCHAR buffer[BUFSIZE];
330+
if (!PathRemoveFileSpec(exepath)) {
331+
fwprintf(stderr,
332+
L"Invalid executable path: %s\n", exepath);
333+
ExitProcess(1);
334+
}
335+
336+
/* set the default exe module */
337+
wcscpy(exe, exepath);
338+
wcscpy(buffer, exepath);
339+
PathAppend(exe, msystem_bin);
340+
PathAppend(exe, L"wish.exe");
341+
if (_waccess(exe, 0) != -1)
342+
PathAppend(buffer, msystem_bin);
343+
else {
344+
wcscpy(exe, exepath);
345+
PathAppend(exe, L"mingw\\bin\\wish.exe");
346+
PathAppend(buffer, L"mingw\\bin");
347+
}
348+
PathAppend(buffer, L"gitk");
349+
prefix_args = buffer;
350+
prefix_args_len = wcslen(buffer);
351+
}
328352

329353
if (needs_env_setup)
330354
setup_environment(exepath);

0 commit comments

Comments
 (0)