]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/stash.c
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / builtin / stash.c
index 4fc44b35e472b8dfe4cb6a09043dfcc4031d7614..d913487a43f913bc4ecb59c3f4739ee9b56ada79 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();
                }
        }
 
@@ -1086,8 +1088,9 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
        }
 
        cp_upd_index.git_cmd = 1;
-       argv_array_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
-                        "--remove", "--stdin", NULL);
+       argv_array_pushl(&cp_upd_index.args, "update-index",
+                        "--ignore-skip-worktree-entries",
+                        "-z", "--add", "--remove", "--stdin", NULL);
        argv_array_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
                         stash_index_path.buf);
 
@@ -1390,7 +1393,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
                        struct child_process cp = CHILD_PROCESS_INIT;
                        cp.git_cmd = 1;
                        argv_array_pushl(&cp.args, "reset", "--hard", "-q",
-                                        NULL);
+                                        "--no-recurse-submodules", NULL);
                        if (run_command(&cp)) {
                                ret = -1;
                                goto done;