]> git.ipfire.org Git - thirdparty/git.git/commitdiff
common-main: call git_setup_gettext()
authorJeff King <peff@peff.net>
Fri, 1 Jul 2016 06:07:01 +0000 (02:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jul 2016 22:09:10 +0000 (15:09 -0700)
This should be part of every program, as otherwise users do
not get translated error messages. However, some external
commands forgot to do so (e.g., git-credential-store). This
fixes them, and eliminates the repeated code in programs
that did remember to use it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 files changed:
common-main.c
daemon.c
fast-import.c
git.c
http-backend.c
http-fetch.c
http-push.c
imap-send.c
remote-curl.c
shell.c
show-index.c
upload-pack.c

index 20e55ef7d7681ddda6a29e26d196e484c8720b7a..3be5ad18e1d07fe9dad4b2d9df37a619bd175a33 100644 (file)
@@ -37,6 +37,8 @@ int main(int argc, char **av)
         */
        sanitize_stdfds();
 
+       git_setup_gettext();
+
        argv[0] = git_extract_argv0_path(argv[0]);
 
        restore_sigpipe_to_default();
index 981338414ed7b0c1a0d32d6f3dea38088677d6ed..569997c98fcb3a4e2dea9eae698a8cbb839d89b2 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1187,8 +1187,6 @@ int cmd_main(int argc, const char **argv)
        struct credentials *cred = NULL;
        int i;
 
-       git_setup_gettext();
-
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
                const char *v;
index 72d209c19a774c25f8f5f33a92a404723f9e941b..c434272566158a5e46d367510848c69875c3041c 100644 (file)
@@ -3384,8 +3384,6 @@ int cmd_main(int argc, const char **argv)
 {
        unsigned int i;
 
-       git_setup_gettext();
-
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage(fast_import_usage);
 
diff --git a/git.c b/git.c
index ccb24fd26a659dadf904e4e48823430fcf22bee9..0f1937fd0c23da7c316540b8f9a6b05746011506 100644 (file)
--- a/git.c
+++ b/git.c
@@ -618,8 +618,6 @@ int cmd_main(int argc, const char **argv)
        if (!cmd)
                cmd = "git-help";
 
-       git_setup_gettext();
-
        trace_command_performance(argv);
 
        /*
index 2926d1f9e7ba67dfc0e4b4b47b682836c8b733d4..5a17bcac87e26fd29683d114a82a5a580ca3e9b2 100644 (file)
@@ -640,8 +640,6 @@ int cmd_main(int argc, const char **argv)
        char *cmd_arg = NULL;
        int i;
 
-       git_setup_gettext();
-
        set_die_routine(die_webcgi);
        set_die_is_recursing_routine(die_webcgi_recursing);
 
index 244cd0db5d8d8e7dbcbfc78c234c3fc792e919e7..3b556d66196277b2730f7e3d366a28a9d5ad1c56 100644 (file)
@@ -22,8 +22,6 @@ int cmd_main(int argc, const char **argv)
        int get_verbosely = 0;
        int get_recover = 0;
 
-       git_setup_gettext();
-
        while (arg < argc && argv[arg][0] == '-') {
                if (argv[arg][1] == 't') {
                        get_tree = 1;
index acfcd1f1ad8fd7c03089ee32ed8c4c259675ab31..366794d70742ad641f2dfd4832653c460b23b9d0 100644 (file)
@@ -1709,8 +1709,6 @@ int cmd_main(int argc, const char **argv)
        int new_refs;
        struct ref *ref, *local_refs;
 
-       git_setup_gettext();
-
        repo = xcalloc(1, sizeof(*repo));
 
        argv++;
index 125b2183a708a806e7f8aee049b187af3601e7cc..9cbe27fcd44d81465ac20bf99cc6efadb36f4097 100644 (file)
@@ -1500,8 +1500,6 @@ int cmd_main(int argc, const char **argv)
        int total;
        int nongit_ok;
 
-       git_setup_gettext();
-
        setup_git_directory_gently(&nongit_ok);
        git_imap_config();
 
index cdbaed1479d4a230fb4cca0aecd44a343d1394a3..46a55d28f588e4ee9762b92c94aa3a98ae9d0b75 100644 (file)
@@ -989,8 +989,6 @@ int cmd_main(int argc, const char **argv)
        struct strbuf buf = STRBUF_INIT;
        int nongit;
 
-       git_setup_gettext();
-
        setup_git_directory_gently(&nongit);
        if (argc < 2) {
                error("remote-curl: usage: git remote-curl <remote> [<url>]");
diff --git a/shell.c b/shell.c
index 5e70acb9a6c8bd60be59854598bb9f1fb60fb643..464ee1a201ff014c390ddfd653088f7dffd13a84 100644 (file)
--- a/shell.c
+++ b/shell.c
@@ -145,8 +145,6 @@ int cmd_main(int argc, const char **argv)
        struct commands *cmd;
        int count;
 
-       git_setup_gettext();
-
        /*
         * Special hack to pretend to be a CVS server
         */
index 575f9c589456a054d208fd9c38666bb351cb0b70..1ead41e21131fcb3facc71c8e1d96bf5b65dbe8d 100644 (file)
@@ -11,8 +11,6 @@ int cmd_main(int argc, const char **argv)
        unsigned int version;
        static unsigned int top_index[256];
 
-       git_setup_gettext();
-
        if (argc != 1)
                usage(show_index_usage);
        if (fread(top_index, 2 * 4, 1, stdin) != 1)
index 8f2dd7d49abeaf617234cbcad7319a27ca023fd8..f0a0fdaf71f69043323b237ae6acc9be87cb7fdf 100644 (file)
@@ -823,8 +823,6 @@ int cmd_main(int argc, const char **argv)
        int i;
        int strict = 0;
 
-       git_setup_gettext();
-
        packet_trace_identity("upload-pack");
        check_replace_refs = 0;