Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-03 01:30:45 +0300
committerJunio C Hamano <gitster@pobox.com>2018-08-03 01:30:45 +0300
commitcd3f067815d145e284369d1bfc4fa16aec8d8eab (patch)
tree5555cc085a70471571f4a442e7af63b900b56543 /sequencer.c
parentc99033060ff7511864e404c18040ffa236f81404 (diff)
parentab5e67d7513ac6efb4c0ee9787aeaa41604c0566 (diff)
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index f12b61fc93..31038472fd 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);