[PATCH v4] stash: avoid recursive hard reset on submodules

2019-10-12 Thread Jakob Jarmar
reset --hard never recurses into submodules. This matches the behavior of check_changes_tracked_files, which ignores submodules. Signed-off-by: Jakob Jarmar --- Notes: 1. Added space between function name and parentheses 2. Moved test_when_finished cleanup to top of setup_basic builtin

Re: [PATCH v3] stash: avoid recursive hard reset on submodules

2019-10-12 Thread Jakob Jarmar
On Sat, Oct 12, 2019 at 10:46:36AM +0900, Junio C Hamano wrote: > > + git init sub && > > + ( > > + cd sub && > > + test_commit sub_file > > + ) && > > + git init main && > > + ( > > + cd main && > > + git submodule add ../sub && > > + tes

[PATCH v3] stash: avoid recursive hard reset on submodules

2019-10-11 Thread Jakob Jarmar
reset --hard never recurses into submodules. This matches the behavior of check_changes_tracked_files, which ignores submodules. Signed-off-by: Jakob Jarmar --- Notes: I went for two separate tests with the same basic setup, one that does push + pop (which should be valid regardless of

[PATCH v2] stash: avoid recursive hard reset on submodules

2019-10-10 Thread Jakob Jarmar
reset --hard never recurses into submodules. This matches the behavior of check_changes_tracked_files, which ignores submodules. Signed-off-by: Jakob Jarmar --- Sorry for sending a patch with messed up whitespace. This one should be correct. builtin/stash.c | 2 +- git-legacy-stash.sh | 2

[PATCH] stash: avoid recursive hard reset on submodules

2019-10-10 Thread Jakob Jarmar
reset --hard never recurses into submodules. This matches the behavior of check_changes_tracked_files, which ignores submodules. Signed-off-by: Jakob Jarmar --- builtin/stash.c | 2 +- git-legacy-stash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/stash.c b

Possible bug in git stash with submodule.recurse

2019-10-10 Thread Jakob Jarmar
Hi, I ran into an issue where git stash seems to be losing modified content from submodules without warning, if submodule.recurse is true. See below for an example: 1. enable submodule.recurse: ~ $ git config --global submodule.recurse true 2. create the repo to be used as a submodule: ~ $ git