Skip to content

Commit e4b5d2a

Browse files
committed
Merge branch 'wm/rev-parse-die-i18n'
Quite a many die() messages in rev-parse haven't been marked for translation. * wm/rev-parse-die-i18n: rev-parse: mark die() messages for translation
2 parents b009fd4 + e2c5993 commit e4b5d2a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

builtin/rev-parse.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,11 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
435435
/* get the usage up to the first line with a -- on it */
436436
for (;;) {
437437
if (strbuf_getline(&sb, stdin) == EOF)
438-
die("premature end of input");
438+
die(_("premature end of input"));
439439
ALLOC_GROW(usage, unb + 1, usz);
440440
if (!strcmp("--", sb.buf)) {
441441
if (unb < 1)
442-
die("no usage string given before the `--' separator");
442+
die(_("no usage string given before the `--' separator"));
443443
usage[unb] = NULL;
444444
break;
445445
}
@@ -545,7 +545,7 @@ static void die_no_single_rev(int quiet)
545545
if (quiet)
546546
exit(1);
547547
else
548-
die("Needed a single revision");
548+
die(_("Needed a single revision"));
549549
}
550550

551551
static const char builtin_rev_parse_usage[] =
@@ -709,10 +709,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
709709
if (!strcmp(arg, "--resolve-git-dir")) {
710710
const char *gitdir = argv[++i];
711711
if (!gitdir)
712-
die("--resolve-git-dir requires an argument");
712+
die(_("--resolve-git-dir requires an argument"));
713713
gitdir = resolve_gitdir(gitdir);
714714
if (!gitdir)
715-
die("not a gitdir '%s'", argv[i]);
715+
die(_("not a gitdir '%s'"), argv[i]);
716716
puts(gitdir);
717717
continue;
718718
}
@@ -736,7 +736,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
736736
if (!seen_end_of_options && *arg == '-') {
737737
if (!strcmp(arg, "--git-path")) {
738738
if (!argv[i + 1])
739-
die("--git-path requires an argument");
739+
die(_("--git-path requires an argument"));
740740
strbuf_reset(&buf);
741741
print_path(git_path("%s", argv[i + 1]), prefix,
742742
format,
@@ -746,7 +746,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
746746
}
747747
if (!strcmp(arg,"-n")) {
748748
if (++i >= argc)
749-
die("-n requires an argument");
749+
die(_("-n requires an argument"));
750750
if ((filter & DO_FLAGS) && (filter & DO_REVS)) {
751751
show(arg);
752752
show(argv[i]);
@@ -760,26 +760,26 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
760760
}
761761
if (opt_with_value(arg, "--path-format", &arg)) {
762762
if (!arg)
763-
die("--path-format requires an argument");
763+
die(_("--path-format requires an argument"));
764764
if (!strcmp(arg, "absolute")) {
765765
format = FORMAT_CANONICAL;
766766
} else if (!strcmp(arg, "relative")) {
767767
format = FORMAT_RELATIVE;
768768
} else {
769-
die("unknown argument to --path-format: %s", arg);
769+
die(_("unknown argument to --path-format: %s"), arg);
770770
}
771771
continue;
772772
}
773773
if (!strcmp(arg, "--default")) {
774774
def = argv[++i];
775775
if (!def)
776-
die("--default requires an argument");
776+
die(_("--default requires an argument"));
777777
continue;
778778
}
779779
if (!strcmp(arg, "--prefix")) {
780780
prefix = argv[++i];
781781
if (!prefix)
782-
die("--prefix requires an argument");
782+
die(_("--prefix requires an argument"));
783783
startup_info->prefix = prefix;
784784
output_prefix = 1;
785785
continue;
@@ -848,7 +848,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
848848
else if (!strcmp(arg, "loose"))
849849
abbrev_ref_strict = 0;
850850
else
851-
die("unknown mode for --abbrev-ref: %s",
851+
die(_("unknown mode for --abbrev-ref: %s"),
852852
arg);
853853
}
854854
continue;
@@ -892,7 +892,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
892892
if (work_tree)
893893
print_path(work_tree, prefix, format, DEFAULT_UNMODIFIED);
894894
else
895-
die("this operation must be run in a work tree");
895+
die(_("this operation must be run in a work tree"));
896896
continue;
897897
}
898898
if (!strcmp(arg, "--show-superproject-working-tree")) {
@@ -1020,7 +1020,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
10201020
if (strcmp(val, "storage") &&
10211021
strcmp(val, "input") &&
10221022
strcmp(val, "output"))
1023-
die("unknown mode for --show-object-format: %s",
1023+
die(_("unknown mode for --show-object-format: %s"),
10241024
arg);
10251025
puts(the_hash_algo->name);
10261026
continue;
@@ -1058,7 +1058,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
10581058
if (verify)
10591059
die_no_single_rev(quiet);
10601060
if (has_dashdash)
1061-
die("bad revision '%s'", arg);
1061+
die(_("bad revision '%s'"), arg);
10621062
as_is = 1;
10631063
if (!show_file(arg, output_prefix))
10641064
continue;

0 commit comments

Comments
 (0)