Re: [PATCH v4 20/20] mktag: add a --no-strict option
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Dec 23, 2020, 22:20 UTC
- Message-ID
- <20201223222031.GK8396@szeder.dev>
- In-Reply-To
- <20201223013606.7972-21-avarab@gmail.com>
On Wed, Dec 23, 2020 at 02:36:05AM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> Now that mktag has been migrated to use the fsck machinery to check > its input, it makes sense to teach it to run in the equivalent of "git > fsck"'s default mode, instead of hardcoding "git fsck --strict". Let's > do that and support the "--no-strict" option. > > Since this is a new option we don't need to cater to parse-option.c's > default of automatically supporting --strict. So let's use > PARSE_OPT_NONEG, using a new trivial helper macro. > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Show 13 quoted lines
> diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh
> index 2e8b718379..b436ae1e44 100755
> --- a/t/t3800-mktag.sh
> +++ b/t/t3800-mktag.sh
> @@ -12,12 +12,16 @@ test_description='git mktag: tag object verify test'
> # given in the expect.pat file.
>
> check_verify_failure () {
> - expect="$2"
> - test_expect_success "$1" '
> + test_expect_success "$1" "
> test_must_fail env GIT_TEST_GETTEXT_POISON=false \
> git mktag <tag.sig 2>message &&So this 'git mktag' is always invoked with GIT_TEST_GETTEXT_POISON=false (instead of, for some reason, using test_i18ngrep on the next line)...
Show 6 quoted lines
> - grep "$expect" message > - ' > + grep '$2' message && > + if test '$3' != '--no-strict' > + then > + test_must_fail git mktag --no-strict <tag.sig 2>message.no-strict &&
Wouldn't a GIT_TEST_GETTEXT_POISON=false be necessary for this 'git mktag' as well? Or, alternatively (preferably?), a test_i18ngrep below.
Show 6 quoted lines
> + grep '$2' message.no-strict
> + fi
> + "
> }
>
> test_expect_mktag_success() {