On Fri, Jun 28, 2019 at 05:32:35PM -0400, Eric Sunshine wrote:
> On Fri, Jun 28, 2019 at 5:39 AM Jeff King <[email protected]> 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.