]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/stash.c
Merge branch 'dl/t0000-skip-test-test'
[thirdparty/git.git] / builtin / stash.c
index ab30d1e9203b42dec154b4b171f74ba7fec1b6b7..bb4f6d8d762d833e6cc15accf70f2680dd7af721 100644 (file)
@@ -427,6 +427,8 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
                                return error(_("could not save index tree"));
 
                        reset_head();
+                       discard_cache();
+                       read_cache();
                }
        }
 
@@ -497,6 +499,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);
        }