Re: [PATCH v5 2/3] merge: replace atoi() with strtol_i() for marker size validation
- From
Usman Akinyemi <usmanakinyemi202@gmail.com>
- Date
- Oct 24, 2024, 00:23 UTC
- Message-ID
- <CAPSxiM_itN9gHJzP4Zg6MKfLJKjgLW_o1jp0OqcAEcvn7ZcR+A@mail.gmail.com>
- In-Reply-To
- <ZxldXMfsCuiyeIE8@nand.local>
On Wed, Oct 23, 2024 at 8:32 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 25 quoted lines
>
> On Wed, Oct 23, 2024 at 07:40:19AM +0000, Usman Akinyemi via GitGitGadget wrote:
> > diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
> > index 9bf95249347..c2a9cf03808 100755
> > --- a/t/t6406-merge-attr.sh
> > +++ b/t/t6406-merge-attr.sh
> > @@ -118,6 +118,12 @@ test_expect_success 'retry the merge with longer context' '
> > grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual
> > '
> >
> > +test_expect_success 'invalid conflict-marker-size 3a' '
> > + echo "text conflict-marker-size=3a" >>.gitattributes &&
> > + git checkout -m text 2>error &&
> > + test_grep "warning: invalid marker-size ${SQ}3a${SQ}, expecting an integer" error
> > +'
> > +
>
> Do subsequent tests further down in this script depend on .gitattributes
> not having invalid lines? If so, you may want to instead write:
>
> cp .gitattributes .gitattributes.bak &&
> echo "text conflict-marker-size=3a" >>.gitattributes &&
> test_when_finished "mv .gitattributes.bak .gitattributes" &&
>
> instead.Thanks for the review. Usman
> > Thanks, > Taylor