Re: [PATCH 04/15] Add new test to ensure git-merge handles pull.twohead and pull.octopus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 04, 2008 at 05:34:05PM +0100, Mike Ralphson <mike.ralphson@xxxxxxxxx> wrote:
> > +conflict_count()
> > +{
> > +       eval $1=`{
> > +               git diff-files --name-only
> > +               git ls-files --unmerged
> > +       } | wc -l`
> > +}
> > +
> 
> This here causes the test to fail on AIX (and likely other OS, such as
> apparently OSX) where wc -l outputs whitespace. See
> http://article.gmane.org/gmane.comp.version-control.git/80450
> 
> Here we want the line count not just a return value, so is the
> following acceptable?
> 
> diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
> index 32585f8..9b6097d 100755
> --- a/t/t7601-merge-pull-config.sh
> +++ b/t/t7601-merge-pull-config.sh
> @@ -73,7 +73,7 @@ conflict_count()
>         eval $1=`{
>                 git diff-files --name-only
>                 git ls-files --unmerged
> -       } | wc -l`
> +       } | wc -l | tr -d \ `
>  }

At least it does not break the test for me on Linux. But haven't this
cause you problems in git-merge.sh?  I copied this code chunk from
there.

> Anyway, I thought we preferred $() to backticks?

See above, but sure, we can.

Attachment: pgpjXmDdsGnyU.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux