From: Eric Sunshine Date: Wed, 12 Jun 2019 19:35:50 GMT Subject: Re: [PATCH 1/1] submodule foreach: fix recursion of options Message-ID: In-Reply-To: On Wed, Jun 12, 2019 at 2:10 PM Morian Sonnet via GitGitGadget wrote: > [...] > . Add -- before the command to execute, such that now correctly > > git --super-prefix submodule--helper \ > foreach --recursive -- git reset --hard > > is called. > > Signed-off-by: Morian Sonnet > --- > 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 ... )