rev-parse: mark die() messages for translation

These error messages are intended for the user. Let's touch them up since we're here from the previous commit. Signed-off-by: Wolfgang Müller <wolf@oriole.systems> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Wolfgang Müller committed May 17, 2021 at 10:02 UTC e2c5993744f2c802a907cba1cfb226dc688b527e
1 file changed +15 -15
builtin/rev-parse.c
+15 -15
@@ -435,11 +435,11 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
435 /* get the usage up to the first line with a -- on it */
436 for (;;) {
437 if (strbuf_getline(&sb, stdin) == EOF)
438 - die("premature end of input");
438 + die(_("premature end of input"));
439 ALLOC_GROW(usage, unb + 1, usz);
440 if (!strcmp("--", sb.buf)) {
441 if (unb < 1)
442 - die("no usage string given before the `--' separator");
442 + die(_("no usage string given before the `--' separator"));
443 usage[unb] = NULL;
444 break;
445 }
@@ -545,7 +545,7 @@ static void die_no_single_rev(int quiet)
545 if (quiet)
546 exit(1);
547 else
548 - die("Needed a single revision");
548 + die(_("Needed a single revision"));
549 }
550
551 static const char builtin_rev_parse_usage[] =
@@ -709,10 +709,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
709 if (!strcmp(arg, "--resolve-git-dir")) {
710 const char *gitdir = argv[++i];
711 if (!gitdir)
712 - die("--resolve-git-dir requires an argument");
712 + die(_("--resolve-git-dir requires an argument"));
713 gitdir = resolve_gitdir(gitdir);
714 if (!gitdir)
715 - die("not a gitdir '%s'", argv[i]);
715 + die(_("not a gitdir '%s'"), argv[i]);
716 puts(gitdir);
717 continue;
718 }
@@ -736,7 +736,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
736 if (!seen_end_of_options && *arg == '-') {
737 if (!strcmp(arg, "--git-path")) {
738 if (!argv[i + 1])
739 - die("--git-path requires an argument");
739 + die(_("--git-path requires an argument"));
740 strbuf_reset(&buf);
741 print_path(git_path("%s", argv[i + 1]), prefix,
742 format,
@@ -746,7 +746,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
746 }
747 if (!strcmp(arg,"-n")) {
748 if (++i >= argc)
749 - die("-n requires an argument");
749 + die(_("-n requires an argument"));
750 if ((filter & DO_FLAGS) && (filter & DO_REVS)) {
751 show(arg);
752 show(argv[i]);
@@ -760,26 +760,26 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
760 }
761 if (opt_with_value(arg, "--path-format", &arg)) {
762 if (!arg)
763 - die("--path-format requires an argument");
763 + die(_("--path-format requires an argument"));
764 if (!strcmp(arg, "absolute")) {
765 format = FORMAT_CANONICAL;
766 } else if (!strcmp(arg, "relative")) {
767 format = FORMAT_RELATIVE;
768 } else {
769 - die("unknown argument to --path-format: %s", arg);
769 + die(_("unknown argument to --path-format: %s"), arg);
770 }
771 continue;
772 }
773 if (!strcmp(arg, "--default")) {
774 def = argv[++i];
775 if (!def)
776 - die("--default requires an argument");
776 + die(_("--default requires an argument"));
777 continue;
778 }
779 if (!strcmp(arg, "--prefix")) {
780 prefix = argv[++i];
781 if (!prefix)
782 - die("--prefix requires an argument");
782 + die(_("--prefix requires an argument"));
783 startup_info->prefix = prefix;
784 output_prefix = 1;
785 continue;
@@ -848,7 +848,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
848 else if (!strcmp(arg, "loose"))
849 abbrev_ref_strict = 0;
850 else
851 - die("unknown mode for --abbrev-ref: %s",
851 + die(_("unknown mode for --abbrev-ref: %s"),
852 arg);
853 }
854 continue;
@@ -892,7 +892,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
892 if (work_tree)
893 print_path(work_tree, prefix, format, DEFAULT_UNMODIFIED);
894 else
895 - die("this operation must be run in a work tree");
895 + die(_("this operation must be run in a work tree"));
896 continue;
897 }
898 if (!strcmp(arg, "--show-superproject-working-tree")) {
@@ -1020,7 +1020,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
1020 if (strcmp(val, "storage") &&
1021 strcmp(val, "input") &&
1022 strcmp(val, "output"))
1023 - die("unknown mode for --show-object-format: %s",
1023 + die(_("unknown mode for --show-object-format: %s"),
1024 arg);
1025 puts(the_hash_algo->name);
1026 continue;
@@ -1058,7 +1058,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
1058 if (verify)
1059 die_no_single_rev(quiet);
1060 if (has_dashdash)
1061 - die("bad revision '%s'", arg);
1061 + die(_("bad revision '%s'"), arg);
1062 as_is = 1;
1063 if (!show_file(arg, output_prefix))
1064 continue;