Re: [PATCH v3 5/8] tests: make GIT_TEST_GETTEXT_POISON a boolean
From: Junio C Hamano <hidden>
Date: 2019-06-24 16:47:26
Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted hunk
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.
quoted hunk
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?