common-main: call git_setup_gettext()
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>
This commit is contained in:
committed by
Junio C Hamano
parent
12e0437f23
commit
5ce5f5fa5a
@@ -37,6 +37,8 @@ int main(int argc, char **av)
|
|||||||
*/
|
*/
|
||||||
sanitize_stdfds();
|
sanitize_stdfds();
|
||||||
|
|
||||||
|
git_setup_gettext();
|
||||||
|
|
||||||
argv[0] = git_extract_argv0_path(argv[0]);
|
argv[0] = git_extract_argv0_path(argv[0]);
|
||||||
|
|
||||||
restore_sigpipe_to_default();
|
restore_sigpipe_to_default();
|
||||||
|
|||||||
2
daemon.c
2
daemon.c
@@ -1187,8 +1187,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
struct credentials *cred = NULL;
|
struct credentials *cred = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
const char *arg = argv[i];
|
const char *arg = argv[i];
|
||||||
const char *v;
|
const char *v;
|
||||||
|
|||||||
@@ -3384,8 +3384,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||||
usage(fast_import_usage);
|
usage(fast_import_usage);
|
||||||
|
|
||||||
|
|||||||
2
git.c
2
git.c
@@ -618,8 +618,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
if (!cmd)
|
if (!cmd)
|
||||||
cmd = "git-help";
|
cmd = "git-help";
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
trace_command_performance(argv);
|
trace_command_performance(argv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -640,8 +640,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
char *cmd_arg = NULL;
|
char *cmd_arg = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
set_die_routine(die_webcgi);
|
set_die_routine(die_webcgi);
|
||||||
set_die_is_recursing_routine(die_webcgi_recursing);
|
set_die_is_recursing_routine(die_webcgi_recursing);
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
int get_verbosely = 0;
|
int get_verbosely = 0;
|
||||||
int get_recover = 0;
|
int get_recover = 0;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 't') {
|
if (argv[arg][1] == 't') {
|
||||||
get_tree = 1;
|
get_tree = 1;
|
||||||
|
|||||||
@@ -1709,8 +1709,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
int new_refs;
|
int new_refs;
|
||||||
struct ref *ref, *local_refs;
|
struct ref *ref, *local_refs;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
repo = xcalloc(1, sizeof(*repo));
|
repo = xcalloc(1, sizeof(*repo));
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
|
|||||||
@@ -1500,8 +1500,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
int total;
|
int total;
|
||||||
int nongit_ok;
|
int nongit_ok;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
setup_git_directory_gently(&nongit_ok);
|
setup_git_directory_gently(&nongit_ok);
|
||||||
git_imap_config();
|
git_imap_config();
|
||||||
|
|
||||||
|
|||||||
@@ -989,8 +989,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
int nongit;
|
int nongit;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
setup_git_directory_gently(&nongit);
|
setup_git_directory_gently(&nongit);
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
error("remote-curl: usage: git remote-curl <remote> [<url>]");
|
error("remote-curl: usage: git remote-curl <remote> [<url>]");
|
||||||
|
|||||||
2
shell.c
2
shell.c
@@ -145,8 +145,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
struct commands *cmd;
|
struct commands *cmd;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special hack to pretend to be a CVS server
|
* Special hack to pretend to be a CVS server
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
unsigned int version;
|
unsigned int version;
|
||||||
static unsigned int top_index[256];
|
static unsigned int top_index[256];
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage(show_index_usage);
|
usage(show_index_usage);
|
||||||
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
||||||
|
|||||||
@@ -823,8 +823,6 @@ int cmd_main(int argc, const char **argv)
|
|||||||
int i;
|
int i;
|
||||||
int strict = 0;
|
int strict = 0;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
packet_trace_identity("upload-pack");
|
packet_trace_identity("upload-pack");
|
||||||
check_replace_refs = 0;
|
check_replace_refs = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user