mirror of
https://github.com/git/git.git
synced 2025-03-16 09:15:16 +00:00
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>
This commit is contained in:
parent
1f5d271f5e
commit
26b052515d
10
git.c
10
git.c
@ -179,8 +179,6 @@ static int handle_alias(int *argcp, const char ***argv)
|
|||||||
if (alias_string[0] == '!') {
|
if (alias_string[0] == '!') {
|
||||||
const char **alias_argv;
|
const char **alias_argv;
|
||||||
int argc = *argcp, i;
|
int argc = *argcp, i;
|
||||||
struct strbuf sb = STRBUF_INIT;
|
|
||||||
const char *env[2];
|
|
||||||
|
|
||||||
commit_pager_choice();
|
commit_pager_choice();
|
||||||
|
|
||||||
@ -191,13 +189,7 @@ static int handle_alias(int *argcp, const char ***argv)
|
|||||||
alias_argv[i] = (*argv)[i];
|
alias_argv[i] = (*argv)[i];
|
||||||
alias_argv[argc] = NULL;
|
alias_argv[argc] = NULL;
|
||||||
|
|
||||||
strbuf_addstr(&sb, "GIT_PREFIX=");
|
ret = run_command_v_opt(alias_argv, RUN_USING_SHELL);
|
||||||
if (subdir)
|
|
||||||
strbuf_addstr(&sb, subdir);
|
|
||||||
env[0] = sb.buf;
|
|
||||||
env[1] = NULL;
|
|
||||||
ret = run_command_v_opt_cd_env(alias_argv, RUN_USING_SHELL, NULL, env);
|
|
||||||
strbuf_release(&sb);
|
|
||||||
if (ret >= 0) /* normal exit */
|
if (ret >= 0) /* normal exit */
|
||||||
exit(ret);
|
exit(ret);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user