On Wed, Jun 12, 2019 at 2:10 PM Morian Sonnet via GitGitGadget <gitgitgad...@gmail.com> wrote: > [...] > . Add -- before the command to execute, such that now correctly > > git --super-prefix <submodulepath> submodule--helper \ > foreach --recursive -- git reset --hard > > is called. > > Signed-off-by: Morian Sonnet <morianson...@googlemail.com> > --- > diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh > @@ -421,4 +421,9 @@ test_expect_success 'option-like arguments passed to > foreach commands are not lo > +test_expect_success 'option-like arguments passed to foreach recurse > correctly' ' > + cd super && > + git submodule foreach --recursive git reset --hard > +'
Follow the example of the existing tests in this script and do the 'cd' in a subshell so that it doesn't bleed into tests added later following this one, thus confusing them. ( cd super && git submodule foreach ... )