Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Feb 11, 2009, 18:07 UTC
- Message-ID
- <20090211180705.GL30949@spearce.org>
- In-Reply-To
- <1234375406-27099-3-git-send-email-ted@tedpavlic.com>
Ted Pavlic <ted@tedpavlic.com> wrote:
Show 35 quoted lines
> The local coding convention in bash completion is to use [...] rather > than test. Additionally, > > if [...]; then > > is preferred over > > if [...] > then > > and so matching "if [...]\nthen" were changed accordingly. > > Signed-off-by: Ted Pavlic <ted@tedpavlic.com> > --- > contrib/completion/git-completion.bash | 31 +++++++++++-------------------- > 1 files changed, 11 insertions(+), 20 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 6bbe09a..7706170 100755 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -84,39 +84,30 @@ __git_ps1 () > if [ -n "$g" ]; then > local r > local b > - if [ -d "$g/rebase-apply" ] > - then > - if test -f "$g/rebase-apply/rebasing" > - then > + if [ -d "$g/rebase-apply" ]; then > + if [ -f "$g/rebase-apply/rebasing" ]; then > r="|REBASE" > - elif test -f "$g/rebase-apply/applying" > - then > + elif [ -f "$g/rebase-apply/applying" ]; then
There is some sort of whitespace damage right here, the elif doesn't seem to line up correctly.
-- Shawn.