]> git.ipfire.org Git - thirdparty/git.git/commit
stash: avoid recursive hard reset on submodules
authorJakob Jarmar <jakob.j@gmail.com>
Sat, 12 Oct 2019 15:38:29 +0000 (17:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Oct 2019 01:34:44 +0000 (10:34 +0900)
commit556895d0c8e95a8c2fb41434a5b9bf453e9367f6
tree278790932c8b641264dd1fea63410d9bca5ff056
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
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>
builtin/stash.c
git-legacy-stash.sh
t/t3906-stash-submodule.sh