Skip to content

Commit 8355305

Browse files
committed
git-wrapper: remove 'gui' and 'citool' handling
In the meantime, Git for Windows learned to handle those subcommands quite well itself; There is no longer a need to special-case them in the wrapper. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2ac10bd commit 8355305

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

compat/win32/git-wrapper.c

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,15 @@ static void setup_environment(LPWSTR exepath)
118118
static LPWSTR fixup_commandline(LPWSTR exepath, LPWSTR *exep, int *wait,
119119
LPWSTR prefix_args, int prefix_args_len, int is_git_command)
120120
{
121-
int wargc = 0, gui = 0;
121+
int wargc = 0;
122122
LPWSTR cmd = NULL, cmdline = NULL;
123123
LPWSTR *wargv = NULL, p = NULL;
124124

125125
cmdline = GetCommandLine();
126126
wargv = CommandLineToArgvW(cmdline, &wargc);
127127
cmd = (LPWSTR)malloc(sizeof(WCHAR) *
128128
(wcslen(cmdline) + prefix_args_len + 1 + MAX_PATH));
129-
if (wargc > 1 && wcsicmp(L"gui", wargv[1]) == 0) {
130-
*wait = 0;
131-
if (wargc > 2 && wcsicmp(L"citool", wargv[2]) == 0) {
132-
*wait = 1;
133-
wcscpy(cmd, L"git.exe");
134-
}
135-
else {
136-
WCHAR script[MAX_PATH];
137-
gui = 1;
138-
wcscpy(script, exepath);
139-
PathAppend(script,
140-
L"libexec\\git-core\\git-gui");
141-
PathQuoteSpaces(script);
142-
wcscpy(cmd, L"wish.exe ");
143-
wcscat(cmd, script);
144-
wcscat(cmd, L" --");
145-
/* find the module from the commandline */
146-
*exep = NULL;
147-
}
148-
}
149-
else if (prefix_args) {
129+
if (prefix_args) {
150130
if (is_git_command)
151131
_swprintf(cmd, L"%s\\%s %.*s", exepath, L"git.exe",
152132
prefix_args_len, prefix_args);
@@ -159,15 +139,8 @@ static LPWSTR fixup_commandline(LPWSTR exepath, LPWSTR *exep, int *wait,
159139

160140
/* append all after first space after the initial parameter */
161141
p = wcschr(&cmdline[wcslen(wargv[0])], L' ');
162-
if (p && *p) {
163-
/* for git gui subcommands, remove the 'gui' word */
164-
if (gui) {
165-
while (*p == L' ') ++p;
166-
p = wcschr(p, L' ');
167-
}
168-
if (p && *p)
169-
wcscat(cmd, p);
170-
}
142+
if (p && *p)
143+
wcscat(cmd, p);
171144
LocalFree(wargv);
172145

173146
return cmd;

0 commit comments

Comments
 (0)