{"thread":{"id":"52017","subject":"[PATCH] stash: avoid recursive hard reset on submodules","startedAt":"2019-10-10T23:35:03Z","lastAt":"2019-10-15T01:35:42Z","messageCount":8,"participants":["Jakob Jarmar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"383849","messageId":"CA+xNDHtVc7pJr=SdihKDKiLE9TE_TcpEWWmPq+N9+fFcfM36wA@mail.gmail.com","threadId":"52017","inReplyTo":null,"subject":"[PATCH] stash: avoid recursive hard reset on submodules","fromName":"Jakob Jarmar","fromEmail":"jakob.j@gmail.com","sentAt":"2019-10-10T23:34:56Z","receivedAt":"2019-10-10T23:35:03Z","isPatch":true,"sender":{"key":"jakob.j@gmail.com","avatar":"https://avatars.githubusercontent.com/u/604850?v=4"},"body":"git stash push does not recursively stash submodules, but if\nsubmodule.recurse is set, it may recursively reset --hard them. Having\nonly the destructive action recurse is likely to be surprising\nbehaviour, and unlikely to be desirable, so the easiest fix should be to\nensure that the call to git reset --hard never recurses into submodules.\n\nThis matches the behavior of check_changes_tracked_files, which ignores\nsubmodules.\n\nSigned-off-by: Jakob Jarmar <jakob@jarmar.se>\n---\n builtin/stash.c     | 2 +-\n git-legacy-stash.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex b5a301f24d..c986c258f2 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec\n*ps, const char *stash_msg, int q\n             struct child_process cp = CHILD_PROCESS_INIT;\n             cp.git_cmd = 1;\n             argv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n-                     NULL);\n+                     \"--no-recurse-submodules\", NULL);\n             if (run_command(&cp)) {\n                 ret = -1;\n                 goto done;\ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\nindex f60e9b3e87..07ad4a5459 100755\n--- a/git-legacy-stash.sh\n+++ b/git-legacy-stash.sh\n@@ -370,7 +370,7 @@ push_stash () {\n             git diff-index -p --cached --binary HEAD -- \"$@\" |\n             git apply --index -R\n         else\n-            git reset --hard -q\n+            git reset --hard -q --no-recurse-submodules\n         fi\n\n         if test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n-- \n2.23.0\n"},{"id":"383854","messageId":"20191011001114.GB640501@OJAN-PAAVO.localdomain","threadId":"52017","inReplyTo":"CA+xNDHtVc7pJr=SdihKDKiLE9TE_TcpEWWmPq+N9+fFcfM36wA@mail.gmail.com","subject":"[PATCH v2] stash: avoid recursive hard reset on submodules","fromName":"Jakob Jarmar","fromEmail":"jakob.j@gmail.com","sentAt":"2019-10-11T00:11:14Z","receivedAt":"2019-10-11T00:11:07Z","isPatch":true,"sender":{"key":"jakob.j@gmail.com","avatar":"https://avatars.githubusercontent.com/u/604850?v=4"},"body":"git stash push does not recursively stash submodules, but if\nsubmodule.recurse is set, it may recursively reset --hard them. Having\nonly the destructive action recurse is likely to be surprising\nbehaviour, and unlikely to be desirable, so the easiest fix should be to\nensure that the call to git reset --hard never recurses into submodules.\n\nThis matches the behavior of check_changes_tracked_files, which ignores\nsubmodules.\n\nSigned-off-by: Jakob Jarmar <jakob@jarmar.se>\n---\n\nSorry for sending a patch with messed up whitespace. This one should be\ncorrect.\n\n builtin/stash.c     | 2 +-\n git-legacy-stash.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex b5a301f24d..c986c258f2 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\t\tcp.git_cmd = 1;\n \t\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n-\t\t\t\t\t NULL);\n+\t\t\t\t\t \"--no-recurse-submodules\", NULL);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\nindex f60e9b3e87..07ad4a5459 100755\n--- a/git-legacy-stash.sh\n+++ b/git-legacy-stash.sh\n@@ -370,7 +370,7 @@ push_stash () {\n \t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n \t\t\tgit apply --index -R\n \t\telse\n-\t\t\tgit reset --hard -q\n+\t\t\tgit reset --hard -q --no-recurse-submodules\n \t\tfi\n \n \t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n-- \n2.23.0\n\n"},{"id":"383875","messageId":"xmqqeezjhlad.fsf@gitster-ct.c.googlers.com","threadId":"52017","inReplyTo":"20191011001114.GB640501@OJAN-PAAVO.localdomain","subject":"Re: [PATCH v2] stash: avoid recursive hard reset on submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-11T06:02:34Z","receivedAt":"2019-10-11T06:02:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakob Jarmar <jakob.j@gmail.com> writes:\n\n> git stash push does not recursively stash submodules, but if\n> submodule.recurse is set, it may recursively reset --hard them. Having\n> only the destructive action recurse is likely to be surprising\n> behaviour, and unlikely to be desirable, so the easiest fix should be to\n> ensure that the call to git reset --hard never recurses into submodules.\n>\n> This matches the behavior of check_changes_tracked_files, which ignores\n> submodules.\n\nMakes sense.  Can we demonstrate an existing breakage and the fix in\na new test or two in perhaps t3906-stash-submodule.sh?\n\nThanks.\n\n>\n> Signed-off-by: Jakob Jarmar <jakob@jarmar.se>\n> ---\n>\n> Sorry for sending a patch with messed up whitespace. This one should be\n> correct.\n>\n>  builtin/stash.c     | 2 +-\n>  git-legacy-stash.sh | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/stash.c b/builtin/stash.c\n> index b5a301f24d..c986c258f2 100644\n> --- a/builtin/stash.c\n> +++ b/builtin/stash.c\n> @@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n>  \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n>  \t\t\tcp.git_cmd = 1;\n>  \t\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n> -\t\t\t\t\t NULL);\n> +\t\t\t\t\t \"--no-recurse-submodules\", NULL);\n>  \t\t\tif (run_command(&cp)) {\n>  \t\t\t\tret = -1;\n>  \t\t\t\tgoto done;\n> diff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\n> index f60e9b3e87..07ad4a5459 100755\n> --- a/git-legacy-stash.sh\n> +++ b/git-legacy-stash.sh\n> @@ -370,7 +370,7 @@ push_stash () {\n>  \t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n>  \t\t\tgit apply --index -R\n>  \t\telse\n> -\t\t\tgit reset --hard -q\n> +\t\t\tgit reset --hard -q --no-recurse-submodules\n>  \t\tfi\n>  \n>  \t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n"},{"id":"383942","messageId":"20191011222448.GA650182@OJAN-PAAVO.localdomain","threadId":"52017","inReplyTo":"xmqqeezjhlad.fsf@gitster-ct.c.googlers.com","subject":"[PATCH v3] stash: avoid recursive hard reset on submodules","fromName":"Jakob Jarmar","fromEmail":"jakob.j@gmail.com","sentAt":"2019-10-11T22:24:48Z","receivedAt":"2019-10-11T22:24:41Z","isPatch":true,"sender":{"key":"jakob.j@gmail.com","avatar":"https://avatars.githubusercontent.com/u/604850?v=4"},"body":"git stash push does not recursively stash submodules, but if\nsubmodule.recurse is set, it may recursively reset --hard them. Having\nonly the destructive action recurse is likely to be surprising\nbehaviour, and unlikely to be desirable, so the easiest fix should be to\nensure that the call to git reset --hard never recurses into submodules.\n\nThis matches the behavior of check_changes_tracked_files, which ignores\nsubmodules.\n\nSigned-off-by: Jakob Jarmar <jakob@jarmar.se>\n---\n\nNotes:\n    I went for two separate tests with the same basic setup, one that does\n    push + pop (which should be valid regardless of future changes), and one\n    that just does push before checking that the submodule still is dirty\n    (which would become invalid if git stash were to learn --recurse-submodules\n    in the future, but matches this approach).\n\n builtin/stash.c            |  2 +-\n git-legacy-stash.sh        |  2 +-\n t/t3906-stash-submodule.sh | 42 +++++++++++++++++++++++++++++++++++++-\n 3 files changed, 43 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex b5a301f24d..c986c258f2 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\t\tcp.git_cmd = 1;\n \t\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n-\t\t\t\t\t NULL);\n+\t\t\t\t\t \"--no-recurse-submodules\", NULL);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\nindex f60e9b3e87..07ad4a5459 100755\n--- a/git-legacy-stash.sh\n+++ b/git-legacy-stash.sh\n@@ -370,7 +370,7 @@ push_stash () {\n \t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n \t\t\tgit apply --index -R\n \t\telse\n-\t\t\tgit reset --hard -q\n+\t\t\tgit reset --hard -q --no-recurse-submodules\n \t\tfi\n \n \t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\ndiff --git a/t/t3906-stash-submodule.sh b/t/t3906-stash-submodule.sh\nindex d7219d6f8f..83106fa958 100755\n--- a/t/t3906-stash-submodule.sh\n+++ b/t/t3906-stash-submodule.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-test_description='stash apply can handle submodules'\n+test_description='stash can handle submodules'\n \n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-submodule-update.sh\n@@ -21,4 +21,44 @@ KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1\n KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1\n test_submodule_switch \"git_stash\"\n \n+setup_basic() {\n+\tgit init sub &&\n+\t(\n+\t\tcd sub &&\n+\t\ttest_commit sub_file\n+\t) &&\n+\tgit init main &&\n+\t(\n+\t\tcd main &&\n+\t\tgit submodule add ../sub &&\n+\t\ttest_commit main_file\n+\t) &&\n+\ttest_when_finished \"rm -rf main sub\"\n+}\n+\n+test_expect_success 'stash push with submodule.recurse=true preserves dirty submodule worktree' '\n+\tsetup_basic &&\n+\t(\n+\t\tcd main &&\n+\t\tgit config submodule.recurse true &&\n+\t\techo \"x\" >main_file.t &&\n+\t\techo \"y\" >sub/sub_file.t &&\n+\t\tgit stash push &&\n+\t\ttest_must_fail git -C sub diff --quiet\n+\t)\n+'\n+\n+test_expect_success 'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '\n+\tsetup_basic &&\n+\t(\n+\t\tcd main &&\n+\t\tgit config submodule.recurse true &&\n+\t\techo \"x\" >main_file.t &&\n+\t\techo \"y\" >sub/sub_file.t &&\n+\t\tgit stash push &&\n+\t\tgit stash pop &&\n+\t\ttest_must_fail git -C sub diff --quiet\n+\t)\n+'\n+\n test_done\n-- \n2.23.0\n\n"},{"id":"383961","messageId":"xmqqsgnyenwj.fsf@gitster-ct.c.googlers.com","threadId":"52017","inReplyTo":"20191011222448.GA650182@OJAN-PAAVO.localdomain","subject":"Re: [PATCH v3] stash: avoid recursive hard reset on submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-12T01:46:36Z","receivedAt":"2019-10-12T01:46:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakob Jarmar <jakob.j@gmail.com> writes:\n\n> diff --git a/t/t3906-stash-submodule.sh b/t/t3906-stash-submodule.sh\n> index d7219d6f8f..83106fa958 100755\n> --- a/t/t3906-stash-submodule.sh\n> +++ b/t/t3906-stash-submodule.sh\n> @@ -1,6 +1,6 @@\n>  #!/bin/sh\n>  \n> -test_description='stash apply can handle submodules'\n> +test_description='stash can handle submodules'\n\nGood attention to the detail ;-)\n\n> +setup_basic() {\n\nStyle.  SP on both sides of () in our shell scripts (as seen in the\nexisting shell function in the same file).\n\n> +\tgit init sub &&\n> +\t(\n> +\t\tcd sub &&\n> +\t\ttest_commit sub_file\n> +\t) &&\n> +\tgit init main &&\n> +\t(\n> +\t\tcd main &&\n> +\t\tgit submodule add ../sub &&\n> +\t\ttest_commit main_file\n> +\t) &&\n> +\ttest_when_finished \"rm -rf main sub\"\n\nHave test_when_finished that removes main and sub _before_ you start\ncreating sub and main.  \n\nWhen the &&-cascade breaks anywhere, the control may not even reach\nyour test_when_finished that registers the clean-up procedure.\nImagine \"git init sub\" succeeds but \"git init main\" somehow\nfails---you still want to clean up \"sub\".\n\nOther than that, looks reasonably well done.  \n\nThanks for working on this.\n\n\n> +}\n> +\n> +test_expect_success 'stash push with submodule.recurse=true preserves dirty submodule worktree' '\n> +\tsetup_basic &&\n> +\t(\n> +\t\tcd main &&\n> +\t\tgit config submodule.recurse true &&\n> +\t\techo \"x\" >main_file.t &&\n> +\t\techo \"y\" >sub/sub_file.t &&\n> +\t\tgit stash push &&\n> +\t\ttest_must_fail git -C sub diff --quiet\n> +\t)\n> +'\n> +\n> +test_expect_success 'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '\n> +\tsetup_basic &&\n> +\t(\n> +\t\tcd main &&\n> +\t\tgit config submodule.recurse true &&\n> +\t\techo \"x\" >main_file.t &&\n> +\t\techo \"y\" >sub/sub_file.t &&\n> +\t\tgit stash push &&\n> +\t\tgit stash pop &&\n> +\t\ttest_must_fail git -C sub diff --quiet\n> +\t)\n> +'\n> +\n>  test_done\n"},{"id":"383968","messageId":"20191012152416.GA743557@OJAN-PAAVO.localdomain","threadId":"52017","inReplyTo":"xmqqsgnyenwj.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v3] stash: avoid recursive hard reset on submodules","fromName":"Jakob Jarmar","fromEmail":"jakob.j@gmail.com","sentAt":"2019-10-12T15:24:16Z","receivedAt":"2019-10-12T15:24:10Z","isPatch":true,"sender":{"key":"jakob.j@gmail.com","avatar":"https://avatars.githubusercontent.com/u/604850?v=4"},"body":"On Sat, Oct 12, 2019 at 10:46:36AM +0900, Junio C Hamano wrote:\n> > +\tgit init sub &&\n> > +\t(\n> > +\t\tcd sub &&\n> > +\t\ttest_commit sub_file\n> > +\t) &&\n> > +\tgit init main &&\n> > +\t(\n> > +\t\tcd main &&\n> > +\t\tgit submodule add ../sub &&\n> > +\t\ttest_commit main_file\n> > +\t) &&\n> > +\ttest_when_finished \"rm -rf main sub\"\n> \n> Have test_when_finished that removes main and sub _before_ you start\n> creating sub and main.  \n> \n> When the &&-cascade breaks anywhere, the control may not even reach\n> your test_when_finished that registers the clean-up procedure.\n> Imagine \"git init sub\" succeeds but \"git init main\" somehow\n> fails---you still want to clean up \"sub\".\n\nAh, of course, will fix this (and the other point as well).\n\n> Other than that, looks reasonably well done.  \n\nThanks. This was fun to figure out and fix.\n"},{"id":"383969","messageId":"20191012153829.GB743557@OJAN-PAAVO.localdomain","threadId":"52017","inReplyTo":"xmqqsgnyenwj.fsf@gitster-ct.c.googlers.com","subject":"[PATCH v4] stash: avoid recursive hard reset on submodules","fromName":"Jakob Jarmar","fromEmail":"jakob.j@gmail.com","sentAt":"2019-10-12T15:38:29Z","receivedAt":"2019-10-12T15:40:33Z","isPatch":true,"sender":{"key":"jakob.j@gmail.com","avatar":"https://avatars.githubusercontent.com/u/604850?v=4"},"body":"git stash push does not recursively stash submodules, but if\nsubmodule.recurse is set, it may recursively reset --hard them. Having\nonly the destructive action recurse is likely to be surprising\nbehaviour, and unlikely to be desirable, so the easiest fix should be to\nensure that the call to git reset --hard never recurses into submodules.\n\nThis matches the behavior of check_changes_tracked_files, which ignores\nsubmodules.\n\nSigned-off-by: Jakob Jarmar <jakob@jarmar.se>\n---\n\nNotes:\n    1. Added space between function name and parentheses\n    2. Moved test_when_finished cleanup to top of setup_basic\n\n builtin/stash.c            |  2 +-\n git-legacy-stash.sh        |  2 +-\n t/t3906-stash-submodule.sh | 42 +++++++++++++++++++++++++++++++++++++-\n 3 files changed, 43 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex b5a301f24d..c986c258f2 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\t\tcp.git_cmd = 1;\n \t\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n-\t\t\t\t\t NULL);\n+\t\t\t\t\t \"--no-recurse-submodules\", NULL);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\nindex f60e9b3e87..07ad4a5459 100755\n--- a/git-legacy-stash.sh\n+++ b/git-legacy-stash.sh\n@@ -370,7 +370,7 @@ push_stash () {\n \t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n \t\t\tgit apply --index -R\n \t\telse\n-\t\t\tgit reset --hard -q\n+\t\t\tgit reset --hard -q --no-recurse-submodules\n \t\tfi\n \n \t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\ndiff --git a/t/t3906-stash-submodule.sh b/t/t3906-stash-submodule.sh\nindex d7219d6f8f..b93d1d74da 100755\n--- a/t/t3906-stash-submodule.sh\n+++ b/t/t3906-stash-submodule.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-test_description='stash apply can handle submodules'\n+test_description='stash can handle submodules'\n \n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-submodule-update.sh\n@@ -21,4 +21,44 @@ KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1\n KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1\n test_submodule_switch \"git_stash\"\n \n+setup_basic () {\n+\ttest_when_finished \"rm -rf main sub\" &&\n+\tgit init sub &&\n+\t(\n+\t\tcd sub &&\n+\t\ttest_commit sub_file\n+\t) &&\n+\tgit init main &&\n+\t(\n+\t\tcd main &&\n+\t\tgit submodule add ../sub &&\n+\t\ttest_commit main_file\n+\t)\n+}\n+\n+test_expect_success 'stash push with submodule.recurse=true preserves dirty submodule worktree' '\n+\tsetup_basic &&\n+\t(\n+\t\tcd main &&\n+\t\tgit config submodule.recurse true &&\n+\t\techo \"x\" >main_file.t &&\n+\t\techo \"y\" >sub/sub_file.t &&\n+\t\tgit stash push &&\n+\t\ttest_must_fail git -C sub diff --quiet\n+\t)\n+'\n+\n+test_expect_success 'stash push and pop with submodule.recurse=true preserves dirty submodule worktree' '\n+\tsetup_basic &&\n+\t(\n+\t\tcd main &&\n+\t\tgit config submodule.recurse true &&\n+\t\techo \"x\" >main_file.t &&\n+\t\techo \"y\" >sub/sub_file.t &&\n+\t\tgit stash push &&\n+\t\tgit stash pop &&\n+\t\ttest_must_fail git -C sub diff --quiet\n+\t)\n+'\n+\n test_done\n-- \n2.23.0\n\n"},{"id":"384053","messageId":"xmqqy2xmdc46.fsf@gitster-ct.c.googlers.com","threadId":"52017","inReplyTo":"20191012153829.GB743557@OJAN-PAAVO.localdomain","subject":"Re: [PATCH v4] stash: avoid recursive hard reset on submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-15T01:35:37Z","receivedAt":"2019-10-15T01:35:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakob Jarmar <jakob.j@gmail.com> writes:\n\n> git stash push does not recursively stash submodules, but if\n> submodule.recurse is set, it may recursively reset --hard them. Having\n> only the destructive action recurse is likely to be surprising\n> behaviour, and unlikely to be desirable, so the easiest fix should be to\n> ensure that the call to git reset --hard never recurses into submodules.\n>\n> This matches the behavior of check_changes_tracked_files, which ignores\n> submodules.\n>\n> Signed-off-by: Jakob Jarmar <jakob@jarmar.se>\n> ---\n>\n> Notes:\n>     1. Added space between function name and parentheses\n>     2. Moved test_when_finished cleanup to top of setup_basic\n\nLooks good; will queue.\n\nThanks.\n"}]}