diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-06 10:49:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-06 10:49:57 -0700 |
commit | 76f4f74a444cdb3d43950c099da60e5d1ad36305 (patch) | |
tree | ef35069c72b7a8a3ba57e9d2ad93ae66a161b440 /git.c | |
parent | 12b99a3598bddfb26efd188ffac6f0e283f02d5a (diff) | |
parent | 7cf16a14f5c070f7b14cf28023769450133172ae (diff) | |
download | git-76f4f74a444cdb3d43950c099da60e5d1ad36305.tar.gz |
Merge branch 'mg/alias-expose-prefix'
* mg/alias-expose-prefix:
handle_alias: provide GIT_PREFIX to !alias
t1020: test !alias in subdirectory
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |