Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Jarmar <jakob.j@gmail.com>2019-10-12 18:38:29 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-15 04:34:44 +0300
commit556895d0c8e95a8c2fb41434a5b9bf453e9367f6 (patch)
tree278790932c8b641264dd1fea63410d9bca5ff056 /git-legacy-stash.sh
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 (diff)
stash: avoid recursive hard reset on submodules
git stash push does not recursively stash submodules, but if submodule.recurse is set, it may recursively reset --hard them. Having only the destructive action recurse is likely to be surprising behaviour, and unlikely to be desirable, so the easiest fix should be to ensure that the call to git reset --hard never recurses into submodules. This matches the behavior of check_changes_tracked_files, which ignores submodules. Signed-off-by: Jakob Jarmar <jakob@jarmar.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-legacy-stash.sh')
-rwxr-xr-xgit-legacy-stash.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-legacy-stash.sh b/git-legacy-stash.sh
index f60e9b3e87..07ad4a5459 100755
--- a/git-legacy-stash.sh
+++ b/git-legacy-stash.sh
@@ -370,7 +370,7 @@ push_stash () {
git diff-index -p --cached --binary HEAD -- "$@" |
git apply --index -R
else
- git reset --hard -q
+ git reset --hard -q --no-recurse-submodules
fi
if test "$keep_index" = "t" && test -n "$i_tree"