Skip to content

Commit 027a453

Browse files
committed
Merge branch 'jj/stash-reset-only-toplevel' into pu
* jj/stash-reset-only-toplevel: stash: avoid recursive hard reset on submodules
2 parents 2e2ae8f + 5056878 commit 027a453

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/stash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
13921392
struct child_process cp = CHILD_PROCESS_INIT;
13931393
cp.git_cmd = 1;
13941394
argv_array_pushl(&cp.args, "reset", "--hard", "-q",
1395-
NULL);
1395+
"--no-recurse-submodules", NULL);
13961396
if (run_command(&cp)) {
13971397
ret = -1;
13981398
goto done;

git-legacy-stash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ push_stash () {
370370
git diff-index -p --cached --binary HEAD -- "$@" |
371371
git apply --index -R
372372
else
373-
git reset --hard -q
373+
git reset --hard -q --no-recurse-submodules
374374
fi
375375

376376
if test "$keep_index" = "t" && test -n "$i_tree"

0 commit comments

Comments
 (0)