diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-02 22:30:45 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-02 22:30:45 (GMT) |
commit | cd3f067815d145e284369d1bfc4fa16aec8d8eab (patch) | |
tree | 5555cc085a70471571f4a442e7af63b900b56543 /sequencer.c | |
parent | c99033060ff7511864e404c18040ffa236f81404 (diff) | |
parent | ab5e67d7513ac6efb4c0ee9787aeaa41604c0566 (diff) | |
download | git-cd3f067815d145e284369d1bfc4fa16aec8d8eab.zip git-cd3f067815d145e284369d1bfc4fa16aec8d8eab.tar.gz git-cd3f067815d145e284369d1bfc4fa16aec8d8eab.tar.bz2 |
Merge branch 'bc/sequencer-export-work-tree-as-well'
"git rebase" started exporting GIT_DIR environment variable and
exposing it to hook scripts when part of it got rewritten in C.
Instead of matching the old scripted Porcelains' behaviour,
compensate by also exporting GIT_WORK_TREE environment as well to
lessen the damage. This can harm existing hooks that want to
operate on different repository, but the current behaviour is
already broken for them anyway.
* bc/sequencer-export-work-tree-as-well:
sequencer: pass absolute GIT_WORK_TREE to exec commands
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c index f12b61f..3103847 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2645,6 +2645,8 @@ static int do_exec(const char *command_line) fprintf(stderr, "Executing: %s\n", command_line); child_argv[0] = command_line; argv_array_pushf(&child_env, "GIT_DIR=%s", absolute_path(get_git_dir())); + argv_array_pushf(&child_env, "GIT_WORK_TREE=%s", + absolute_path(get_git_work_tree())); status = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL, child_env.argv); |