Re: [PATCH 1/6] test-lib: introduce test_commit_bulk

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

 



On Fri, Jun 28, 2019 at 05:32:35PM -0400, Eric Sunshine wrote:
> On Fri, Jun 28, 2019 at 5:39 AM Jeff King <peff@xxxxxxxx> wrote:

> > +# to have every commit touch the same file, but with unique content. Spaces are
> > +# OK, but you must escape any metacharacters (like backslashes or
> > +# double-quotes) you do not want expanded.
> > +#
> > +test_commit_bulk () {
> > +       [...]
> > +       in_dir=${indir:+-C "$indir"}
> 
> Doesn't this suffer the problem in which some older/broken
> shells[1][2][3][4] incorrectly expand this to:
> 
>     "-C <dir>"
> 
> rather than the expected:
> 
>     -C "<dir>"
> 
> ? Is this something we still care about?
> 
> Same comment applies to other instances of ${indir:+-C "$indir"} below.

I think we don't need any of those "${indir:+-C "$indir"}" parameter
expansions and could simply use 'git -C "$indir" cmd...' everywhere.
$indir is set to empty right at the start of the function, and 'git -C
"" ...' works and doesn't change the working directory.




[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