X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git.c;h=ed899512f9c4220f7d7a2b9e28e1a0eb23c06b8c;hb=7cf16a14f5c070f7b14cf28023769450133172ae;hp=ef598c3e7053b8dd2859f4d582ce2917a804fe42;hpb=936dfc220210bc00c7dc094250c9680620dab291;p=git.git diff --git a/git.c b/git.c index ef598c3e7..ed899512f 100644 --- a/git.c +++ b/git.c @@ -179,6 +179,8 @@ static int handle_alias(int *argcp, const char ***argv) if (alias_string[0] == '!') { const char **alias_argv; int argc = *argcp, i; + struct strbuf sb = STRBUF_INIT; + const char *env[2]; commit_pager_choice(); @@ -189,7 +191,13 @@ static int handle_alias(int *argcp, const char ***argv) alias_argv[i] = (*argv)[i]; alias_argv[argc] = NULL; - ret = run_command_v_opt(alias_argv, RUN_USING_SHELL); + strbuf_addstr(&sb, "GIT_PREFIX="); + 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 */ exit(ret);