Web lists-archives.com

Re: [PATCH v2] read-cache: write all indexes with the same permissions




On Fri, Nov 16, 2018 at 7:29 PM SZEDER Gábor <szeder.dev@xxxxxxxxx> wrote:
>
> On Fri, Nov 16, 2018 at 06:31:05PM +0100, Christian Couder wrote:
> > diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
> > index 2ac47aa0e4..fa1d3d468b 100755
> > --- a/t/t1700-split-index.sh
> > +++ b/t/t1700-split-index.sh
> > @@ -381,6 +381,26 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to "never" and "now"
> >       test $(ls .git/sharedindex.* | wc -l) -le 2
> >  '
> >
> > +test_expect_success POSIXPERM 'same mode for index & split index' '
> > +     git init same-mode &&
> > +     (
> > +             cd same-mode &&
> > +             test_commit A &&
> > +             test_modebits .git/index >index_mode &&
> > +             test_must_fail git config core.sharedRepository &&
> > +             git -c core.splitIndex=true status &&
> > +             shared=$(ls .git/sharedindex.*) &&
>
> I think the command substitution and 'ls' are unnecessary, and
>
>   shared=.git/sharedindex.*
>
> would work as well.

If there is no shared index file with the above we would get:

shared=.git/sharedindex.*
$ echo $shared
.git/sharedindex.*

which seems bug prone to me.