]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/stash.c
Merge branch 'js/stash-apply-in-secondary-worktree'
[thirdparty/git.git] / builtin / stash.c
index ab30d1e9203b42dec154b4b171f74ba7fec1b6b7..4fc44b35e472b8dfe4cb6a09043dfcc4031d7614 100644 (file)
@@ -497,6 +497,10 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
                 */
                cp.git_cmd = 1;
                cp.dir = prefix;
+               argv_array_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
+                                absolute_path(get_git_work_tree()));
+               argv_array_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
+                                absolute_path(get_git_dir()));
                argv_array_push(&cp.args, "status");
                run_command(&cp);
        }