@@ -406,15 +406,15 @@ static int handle_config(const char *key, const char *value, void *cb)
406
406
if (!remote -> receivepack )
407
407
remote -> receivepack = v ;
408
408
else
409
- error ("more than one receivepack given, using the first" );
409
+ error (_ ( "more than one receivepack given, using the first" ) );
410
410
} else if (!strcmp (subkey , "uploadpack" )) {
411
411
const char * v ;
412
412
if (git_config_string (& v , key , value ))
413
413
return -1 ;
414
414
if (!remote -> uploadpack )
415
415
remote -> uploadpack = v ;
416
416
else
417
- error ("more than one uploadpack given, using the first" );
417
+ error (_ ( "more than one uploadpack given, using the first" ) );
418
418
} else if (!strcmp (subkey , "tagopt" )) {
419
419
if (!strcmp (value , "--no-tags" ))
420
420
remote -> fetch_tags = -1 ;
@@ -707,7 +707,7 @@ static void query_refspecs_multiple(struct refspec *rs,
707
707
int find_src = !query -> src ;
708
708
709
709
if (find_src && !query -> dst )
710
- error ("query_refspecs_multiple: need either src or dst" );
710
+ error (_ ( "query_refspecs_multiple: need either src or dst" ) );
711
711
712
712
for (i = 0 ; i < rs -> nr ; i ++ ) {
713
713
struct refspec_item * refspec = & rs -> items [i ];
@@ -735,7 +735,7 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query)
735
735
char * * result = find_src ? & query -> src : & query -> dst ;
736
736
737
737
if (find_src && !query -> dst )
738
- return error ("query_refspecs: need either src or dst" );
738
+ return error (_ ( "query_refspecs: need either src or dst" ) );
739
739
740
740
for (i = 0 ; i < rs -> nr ; i ++ ) {
741
741
struct refspec_item * refspec = & rs -> items [i ];
@@ -996,12 +996,12 @@ static int match_explicit_lhs(struct ref *src,
996
996
* way to delete 'other' ref at the remote end.
997
997
*/
998
998
if (try_explicit_object_name (rs -> src , match ) < 0 )
999
- return error ("src refspec %s does not match any." , rs -> src );
999
+ return error (_ ( "src refspec %s does not match any." ) , rs -> src );
1000
1000
if (allocated_match )
1001
1001
* allocated_match = 1 ;
1002
1002
return 0 ;
1003
1003
default :
1004
- return error ("src refspec %s matches more than one." , rs -> src );
1004
+ return error (_ ( "src refspec %s matches more than one." ) , rs -> src );
1005
1005
}
1006
1006
}
1007
1007
@@ -1041,32 +1041,33 @@ static int match_explicit(struct ref *src, struct ref *dst,
1041
1041
case 0 :
1042
1042
if (starts_with (dst_value , "refs/" )) {
1043
1043
matched_dst = make_linked_ref (dst_value , dst_tail );
1044
+
1044
1045
} else if (is_null_oid (& matched_src -> new_oid )) {
1045
- error ("unable to delete '%s': remote ref does not exist" ,
1046
+ error (_ ( "unable to delete '%s': remote ref does not exist" ) ,
1046
1047
dst_value );
1047
1048
} else if ((dst_guess = guess_ref (dst_value , matched_src ))) {
1048
1049
matched_dst = make_linked_ref (dst_guess , dst_tail );
1049
1050
free (dst_guess );
1050
1051
} else {
1051
- error ("unable to push to unqualified destination: %s\n"
1052
- "The destination refspec neither matches an "
1053
- "existing ref on the remote nor\n"
1054
- "begins with refs/, and we are unable to "
1055
- "guess a prefix based on the source ref." ,
1052
+ error (_ ( "unable to push to unqualified destination: %s\n"
1053
+ "The destination refspec neither matches an "
1054
+ "existing ref on the remote nor\n"
1055
+ "begins with refs/, and we are unable to "
1056
+ "guess a prefix based on the source ref." ) ,
1056
1057
dst_value );
1057
1058
}
1058
1059
break ;
1059
1060
default :
1060
1061
matched_dst = NULL ;
1061
- error ("dst refspec %s matches more than one." ,
1062
+ error (_ ( "dst refspec %s matches more than one." ) ,
1062
1063
dst_value );
1063
1064
break ;
1064
1065
}
1065
1066
if (!matched_dst )
1066
1067
return -1 ;
1067
1068
if (matched_dst -> peer_ref )
1068
- return error ("dst ref %s receives from more than one src." ,
1069
- matched_dst -> name );
1069
+ return error (_ ( "dst ref %s receives from more than one src." ) ,
1070
+ matched_dst -> name );
1070
1071
else {
1071
1072
matched_dst -> peer_ref = allocated_src ?
1072
1073
matched_src :
@@ -1797,7 +1798,7 @@ int get_fetch_map(const struct ref *remote_refs,
1797
1798
if (!starts_with ((* rmp )-> peer_ref -> name , "refs/" ) ||
1798
1799
check_refname_format ((* rmp )-> peer_ref -> name , 0 )) {
1799
1800
struct ref * ignore = * rmp ;
1800
- error ("* Ignoring funny ref '%s' locally" ,
1801
+ error (_ ( "* Ignoring funny ref '%s' locally" ) ,
1801
1802
(* rmp )-> peer_ref -> name );
1802
1803
* rmp = (* rmp )-> next ;
1803
1804
free (ignore -> peer_ref );
@@ -2165,7 +2166,7 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
2165
2166
else if (!colon [1 ])
2166
2167
oidclr (& entry -> expect );
2167
2168
else if (get_oid (colon + 1 , & entry -> expect ))
2168
- return error ("cannot parse expected object name '%s'" , colon + 1 );
2169
+ return error (_ ( "cannot parse expected object name '%s'" ) , colon + 1 );
2169
2170
return 0 ;
2170
2171
}
2171
2172
0 commit comments