Re: [PATCH v5 2/3] merge: replace atoi() with strtol_i() for marker size validation
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 23, 2024, 20:32 UTC
- Message-ID
- <ZxldXMfsCuiyeIE8@nand.local>
- In-Reply-To
- <da9ea10e4e115777c16b32f1cde96a3df8c5cbb1.1729669221.git.gitgitgadget@gmail.com>
On Wed, Oct 23, 2024 at 07:40:19AM +0000, Usman Akinyemi via GitGitGadget wrote:
Show 14 quoted lines
> 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, Taylor