Skip to content

Commit 26b0525

Browse files
davvidgitster
authored andcommitted
git: Remove handling for GIT_PREFIX
handle_alias() no longer needs to set GIT_PREFIX since it is defined in setup_git_directory_gently(). Remove the duplicated effort and use run_command_v_opt() since there is no need to setup the environment. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1f5d271 commit 26b0525

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

git.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ static int handle_alias(int *argcp, const char ***argv)
179179
if (alias_string[0] == '!') {
180180
const char **alias_argv;
181181
int argc = *argcp, i;
182-
struct strbuf sb = STRBUF_INIT;
183-
const char *env[2];
184182

185183
commit_pager_choice();
186184

@@ -191,13 +189,7 @@ static int handle_alias(int *argcp, const char ***argv)
191189
alias_argv[i] = (*argv)[i];
192190
alias_argv[argc] = NULL;
193191

194-
strbuf_addstr(&sb, "GIT_PREFIX=");
195-
if (subdir)
196-
strbuf_addstr(&sb, subdir);
197-
env[0] = sb.buf;
198-
env[1] = NULL;
199-
ret = run_command_v_opt_cd_env(alias_argv, RUN_USING_SHELL, NULL, env);
200-
strbuf_release(&sb);
192+
ret = run_command_v_opt(alias_argv, RUN_USING_SHELL);
201193
if (ret >= 0) /* normal exit */
202194
exit(ret);
203195

0 commit comments

Comments
 (0)