Merge branch 'ab/test-env'
Many GIT_TEST_* environment variables control various aspects of how our tests are run, but a few followed "non-empty is true, empty or unset is false" while others followed the usual "there are a few ways to spell true, like yes, on, etc., and also ways to spell false, like no, off, etc." convention. * ab/test-env: env--helper: mark a file-local symbol as static tests: make GIT_TEST_FAIL_PREREQS a boolean tests: replace test_tristate with "git env--helper" tests README: re-flow a previously changed paragraph tests: make GIT_TEST_GETTEXT_POISON a boolean t6040 test: stop using global "script" variable config.c: refactor die_bad_number() to not call gettext() early env--helper: new undocumented builtin wrapping git_env_*() config tests: simplify include cycle test
This commit is contained in:
@ -68,10 +68,8 @@ const char *get_preferred_languages(void)
|
||||
int use_gettext_poison(void)
|
||||
{
|
||||
static int poison_requested = -1;
|
||||
if (poison_requested == -1) {
|
||||
const char *v = getenv("GIT_TEST_GETTEXT_POISON");
|
||||
poison_requested = v && strlen(v) ? 1 : 0;
|
||||
}
|
||||
if (poison_requested == -1)
|
||||
poison_requested = git_env_bool("GIT_TEST_GETTEXT_POISON", 0);
|
||||
return poison_requested;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user