diff options
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -221,6 +221,14 @@ void setup_work_tree(void) git_dir = make_absolute_path(git_dir); if (!work_tree || chdir(work_tree)) die("This operation must be run in a work tree"); + + /* + * Make sure subsequent git processes find correct worktree + * if $GIT_WORK_TREE is set relative + */ + if (getenv(GIT_WORK_TREE_ENVIRONMENT)) + setenv(GIT_WORK_TREE_ENVIRONMENT, ".", 1); + set_git_dir(make_relative_path(git_dir, work_tree)); initialized = 1; } |