Re: [PATCH v3 5/8] tests: make GIT_TEST_GETTEXT_POISON a boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> diff --git a/config.c b/config.c
> index 374cb33005..b985d60fa4 100644
> --- a/config.c
> +++ b/config.c
> @@ -956,6 +956,15 @@ static void die_bad_number(const char *name, const char *value)
>  	if (!value)
>  		value = "";
>  
> +	if (!strcmp(name, "GIT_TEST_GETTEXT_POISON"))
> +		/*
> +		 * We explicitly *don't* use _() here since it would
> +		 * cause an infinite loop with _() needing to call
> +		 * use_gettext_poison(). This is why marked up
> +		 * translations with N_() above.
> +		 */
> +		die(bad_numeric, value, name, error_type);

;-)  Nicely explained.

> diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh
> index e1d917fd27..8eef60b43f 100644
> --- a/git-sh-i18n.sh
> +++ b/git-sh-i18n.sh
> @@ -17,7 +17,9 @@ export TEXTDOMAINDIR
>  
>  # First decide what scheme to use...
>  GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
> -if test -n "$GIT_TEST_GETTEXT_POISON"
> +if test -n "$GIT_TEST_GETTEXT_POISON" &&
> +	    git env--helper --type=bool --default=0 --exit-code \
> +		GIT_TEST_GETTEXT_POISON

The helper is called only when GIT_TEST_GETTEXT_POISON has a
non-empty string as its value, so it's default is meaningless, no?




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux