Re: [PATCH 1/1] submodule foreach: fix recursion of options
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 12, 2019, 19:35 UTC
- Message-ID
- <CAPig+cR5hV3+8RjB=8Vz2cF6Ycnh_kj+LwraZAehAqYxrEt0xg@mail.gmail.com>
- In-Reply-To
- <e766e5177722dc20837adbd902d596186b1e4997.1560363008.git.gitgitgadget@gmail.com>
On Wed, Jun 12, 2019 at 2:10 PM Morian Sonnet via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 16 quoted lines
> [...] > . 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 <moriansonnet@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 ...
)