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