mirror of
https://github.com/git/git.git
synced 2026-02-02 05:52:45 +00:00
git-wrapper: serve as git-gui.exe, too
To avoid that ugly Console window when calling \cmd\git.exe gui... To avoid confusion with builtins, we need to move the code block handling gitk (and now git-gui, too) to intercept before git-gui is mistaken for a builtin. Unfortunately, git-gui is in libexec/git-core/ while gitk is in bin/, therefore we need slightly more adjustments than just moving and augmenting the gitk case. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -304,6 +304,32 @@ int main(void)
|
||||
&full_path, &skip_arguments)) {
|
||||
/* do nothing */
|
||||
}
|
||||
else if (!wcscmp(basename, L"git-gui.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);
|
||||
PathAppend(exe, msystem_bin);
|
||||
PathAppend(exe, L"wish.exe");
|
||||
if (_waccess(exe, 0) != -1)
|
||||
swprintf(buffer, BUFSIZE,
|
||||
L"\"%s\\%.*s\\libexec\\git-core\"",
|
||||
exepath, wcslen(msystem_bin) - 4, msystem_bin);
|
||||
else {
|
||||
wcscpy(exe, exepath);
|
||||
PathAppend(exe, L"mingw\\bin\\wish.exe");
|
||||
swprintf(buffer, BUFSIZE,
|
||||
L"\"%s\\mingw\\libexec\\git-core\"", exepath);
|
||||
}
|
||||
PathAppend(buffer, L"git-gui");
|
||||
prefix_args = buffer;
|
||||
prefix_args_len = wcslen(buffer);
|
||||
}
|
||||
else if (!wcsncmp(basename, L"git-", 4)) {
|
||||
needs_env_setup = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user