summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2019-06-21 10:18:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-21 16:42:49 (GMT)
commit2e43cd4caa8ad9eb0c53adc1e00dcd027b8710fd (patch)
tree9a4e48e1d0a26315cac40c5782bcc0df59605eb0 /config.c
parentb4f207f339469e604260bdf6da8673db9c9c9105 (diff)
downloadgit-2e43cd4caa8ad9eb0c53adc1e00dcd027b8710fd.zip
git-2e43cd4caa8ad9eb0c53adc1e00dcd027b8710fd.tar.gz
git-2e43cd4caa8ad9eb0c53adc1e00dcd027b8710fd.tar.bz2
config.c: refactor die_bad_number() to not call gettext() early
Prepare die_bad_number() for a change to specially handle GIT_TEST_GETTEXT_POISON calling git_env_bool() by making die_bad_number() not call gettext() early, which would in turn call git_env_bool(). There's no meaningful change here yet, just a re-arrangement of the current code to make that subsequent change easier to read. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/config.c b/config.c
index 296a6d9..374cb33 100644
--- a/config.c
+++ b/config.c
@@ -949,34 +949,35 @@ int git_parse_ssize_t(const char *value, ssize_t *ret)
NORETURN
static void die_bad_number(const char *name, const char *value)
{
- const char * error_type = (errno == ERANGE)? _("out of range"):_("invalid unit");
+ const char *error_type = (errno == ERANGE) ?
+ N_("out of range") : N_("invalid unit");
+ const char *bad_numeric = N_("bad numeric config value '%s' for '%s': %s");
if (!value)
value = "";
if (!(cf && cf->name))
- die(_("bad numeric config value '%s' for '%s': %s"),
- value, name, error_type);
+ die(_(bad_numeric), value, name, _(error_type));
switch (cf->origin_type) {
case CONFIG_ORIGIN_BLOB:
die(_("bad numeric config value '%s' for '%s' in blob %s: %s"),
- value, name, cf->name, error_type);
+ value, name, cf->name, _(error_type));
case CONFIG_ORIGIN_FILE:
die(_("bad numeric config value '%s' for '%s' in file %s: %s"),
- value, name, cf->name, error_type);
+ value, name, cf->name, _(error_type));
case CONFIG_ORIGIN_STDIN:
die(_("bad numeric config value '%s' for '%s' in standard input: %s"),
- value, name, error_type);
+ value, name, _(error_type));
case CONFIG_ORIGIN_SUBMODULE_BLOB:
die(_("bad numeric config value '%s' for '%s' in submodule-blob %s: %s"),
- value, name, cf->name, error_type);
+ value, name, cf->name, _(error_type));
case CONFIG_ORIGIN_CMDLINE:
die(_("bad numeric config value '%s' for '%s' in command line %s: %s"),
- value, name, cf->name, error_type);
+ value, name, cf->name, _(error_type));
default:
die(_("bad numeric config value '%s' for '%s' in %s: %s"),
- value, name, cf->name, error_type);
+ value, name, cf->name, _(error_type));
}
}