diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-11-15 06:04:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-15 06:04:56 +0300 |
commit | adfc49e60bb1ae4e1239d8fd5d35127de160058b (patch) | |
tree | 6126472166194d4bbd1c687d37ad2324fb501471 /sequencer.c | |
parent | fd7c38c7937a25da55943187a29462c3fa7fb487 (diff) | |
parent | 09d7b6c6fab3ad131b71016b61c80d39d532befd (diff) |
Merge branch 'jk/rebase-i-exec-gitdir-fix' into maint
A recent regression in "git rebase -i" that broke execution of git
commands from subdirectories via "exec" insn has been fixed.
* jk/rebase-i-exec-gitdir-fix:
sequencer: pass absolute GIT_DIR to exec commands
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index f2a10cc4f2..332a383b03 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1862,12 +1862,15 @@ static int error_failed_squash(struct commit *commit, static int do_exec(const char *command_line) { + struct argv_array child_env = ARGV_ARRAY_INIT; const char *child_argv[] = { NULL, NULL }; int dirty, status; fprintf(stderr, "Executing: %s\n", command_line); child_argv[0] = command_line; - status = run_command_v_opt(child_argv, RUN_USING_SHELL); + argv_array_pushf(&child_env, "GIT_DIR=%s", absolute_path(get_git_dir())); + status = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL, + child_env.argv); /* force re-reading of the cache */ if (discard_cache() < 0 || read_cache() < 0) @@ -1897,6 +1900,8 @@ static int do_exec(const char *command_line) status = 1; } + argv_array_clear(&child_env); + return status; } |