Re: [PATCH 10/20] git-submodule.sh: avoid "test <cond> -a/-o <cond>"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2014, 23:23 UTC
- Message-ID
- <xmqqoay1d5vi.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1402066563-28519-11-git-send-email-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 10 quoted lines
> @@ -1059,13 +1059,17 @@ cmd_summary() {
> while read mod_src mod_dst sha1_src sha1_dst status sm_path
> do
> # Always show modules deleted or type-changed (blob<->module)
> - test $status = D -o $status = T && echo "$sm_path" && continue
> + case "$status" in
> + [DT])
> + printf '%s\n' "$sm_path" &&
> + continue
> + esacI think this conversion is wrong and causes parse error. The surrounding code cannot be seen in the context of thsi patch, but looks somewhat like this:
modules=$( ....
case "$status" in
[DT])
...
esac
.... )Perhaps you would need to spell it with the extra opening parenthesis, like so:
case string in
([DT])
...
esacor something.