Re: [PATCH 03/18] lib-submodule-update: teach test_submodule_content the -C <dir> flag
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 6, 2017, 20:30 UTC
- Message-ID
- <CAGZ79kbffqxq-D_PBGLYQqz9M1jgighutp8WPYmeTBhdfkuKnw@mail.gmail.com>
- In-Reply-To
- <20170302021135.GA26453@starla>
On Wed, Mar 1, 2017 at 6:11 PM, Eric Wong <e@80x24.org> wrote:
Show 15 quoted lines
> Stefan Beller <sbeller@google.com> wrote:
>> test_submodule_content () {
>> + if test "$1" == "-C"
>
> Use a single '=' for portability in sh. It's also a good idea
> to prefix variables with 'x' or some such, since "$1" could be
> "-n" or some other supported switch for test(1).
> So, something like:
>
> if test x"$1" = "x-C"
>
> ...or use a case statement.
>
> On Debian systems, I use the "checkbashisms" from the
> "devscripts" package to find and avoid bash dependencies.Thanks for review as well as the tip for using checkbashisms,
I'll resend this series with this fix as well as another fix in git-submodule.sh
Thanks, Stefan