@@ -359,7 +359,7 @@ static int handle_config(const char *key, const char *value, void *cb)
359
359
return 0 ;
360
360
/* Handle remote.<name>.* variables */
361
361
if (* name == '/' ) {
362
- warning ("Config remote shorthand cannot begin with '/': %s" ,
362
+ warning (_ ( "config remote shorthand cannot begin with '/': %s") ,
363
363
name );
364
364
return 0 ;
365
365
}
@@ -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 ;
@@ -680,7 +680,7 @@ static int match_name_with_pattern(const char *key, const char *name,
680
680
size_t namelen ;
681
681
int ret ;
682
682
if (!kstar )
683
- die ("Key '%s' of pattern had no '*'" , key );
683
+ die (_ ( "key '%s' of pattern had no '*'") , key );
684
684
klen = kstar - key ;
685
685
ksuffixlen = strlen (kstar + 1 );
686
686
namelen = strlen (name );
@@ -690,7 +690,7 @@ static int match_name_with_pattern(const char *key, const char *name,
690
690
struct strbuf sb = STRBUF_INIT ;
691
691
const char * vstar = strchr (value , '*' );
692
692
if (!vstar )
693
- die ("Value '%s' of pattern has no '*'" , value );
693
+ die (_ ( "value '%s' of pattern has no '*'") , value );
694
694
strbuf_add (& sb , value , vstar - value );
695
695
strbuf_add (& sb , name + klen , namelen - klen - ksuffixlen );
696
696
strbuf_addstr (& sb , vstar + 1 );
@@ -995,12 +995,12 @@ static int match_explicit_lhs(struct ref *src,
995
995
* way to delete 'other' ref at the remote end.
996
996
*/
997
997
if (try_explicit_object_name (rs -> src , match ) < 0 )
998
- return error ("src refspec %s does not match any." , rs -> src );
998
+ return error (_ ( "src refspec %s does not match any" ) , rs -> src );
999
999
if (allocated_match )
1000
1000
* allocated_match = 1 ;
1001
1001
return 0 ;
1002
1002
default :
1003
- return error ("src refspec %s matches more than one." , rs -> src );
1003
+ return error (_ ( "src refspec %s matches more than one" ) , rs -> src );
1004
1004
}
1005
1005
}
1006
1006
@@ -1030,7 +1030,7 @@ static int match_explicit(struct ref *src, struct ref *dst,
1030
1030
if (!dst_value ||
1031
1031
((flag & REF_ISSYMREF ) &&
1032
1032
!starts_with (dst_value , "refs/heads/" )))
1033
- die ("%s cannot be resolved to branch." ,
1033
+ die (_ ( "%s cannot be resolved to branch" ) ,
1034
1034
matched_src -> name );
1035
1035
}
1036
1036
@@ -1041,30 +1041,30 @@ static int match_explicit(struct ref *src, struct ref *dst,
1041
1041
if (starts_with (dst_value , "refs/" ))
1042
1042
matched_dst = make_linked_ref (dst_value , dst_tail );
1043
1043
else if (is_null_oid (& matched_src -> new_oid ))
1044
- error ("unable to delete '%s': remote ref does not exist" ,
1044
+ error (_ ( "unable to delete '%s': remote ref does not exist" ) ,
1045
1045
dst_value );
1046
1046
else if ((dst_guess = guess_ref (dst_value , matched_src ))) {
1047
1047
matched_dst = make_linked_ref (dst_guess , dst_tail );
1048
1048
free (dst_guess );
1049
1049
} else
1050
- error ("unable to push to unqualified destination: %s\n"
1051
- "The destination refspec neither matches an "
1052
- "existing ref on the remote nor\n"
1053
- "begins with refs/, and we are unable to "
1054
- "guess a prefix based on the source ref." ,
1050
+ error (_ ( "unable to push to unqualified destination: %s\n"
1051
+ "The destination refspec neither matches an "
1052
+ "existing ref on the remote nor\n"
1053
+ "begins with refs/, and we are unable to "
1054
+ "guess a prefix based on the source ref." ) ,
1055
1055
dst_value );
1056
1056
break ;
1057
1057
default :
1058
1058
matched_dst = NULL ;
1059
- error ("dst refspec %s matches more than one." ,
1059
+ error (_ ( "dst refspec %s matches more than one" ) ,
1060
1060
dst_value );
1061
1061
break ;
1062
1062
}
1063
1063
if (!matched_dst )
1064
1064
return -1 ;
1065
1065
if (matched_dst -> peer_ref )
1066
- return error ("dst ref %s receives from more than one src." ,
1067
- matched_dst -> name );
1066
+ return error (_ ( "dst ref %s receives from more than one src" ) ,
1067
+ matched_dst -> name );
1068
1068
else {
1069
1069
matched_dst -> peer_ref = allocated_src ?
1070
1070
matched_src :
@@ -1750,7 +1750,7 @@ int get_fetch_map(const struct ref *remote_refs,
1750
1750
ref_map = get_remote_ref (remote_refs , name );
1751
1751
}
1752
1752
if (!missing_ok && !ref_map )
1753
- die ("Couldn 't find remote ref %s" , name );
1753
+ die (_ ( "couldn 't find remote ref %s") , name );
1754
1754
if (ref_map ) {
1755
1755
ref_map -> peer_ref = get_local_ref (refspec -> dst );
1756
1756
if (ref_map -> peer_ref && refspec -> force )
@@ -1763,7 +1763,7 @@ int get_fetch_map(const struct ref *remote_refs,
1763
1763
if (!starts_with ((* rmp )-> peer_ref -> name , "refs/" ) ||
1764
1764
check_refname_format ((* rmp )-> peer_ref -> name , 0 )) {
1765
1765
struct ref * ignore = * rmp ;
1766
- error ("* Ignoring funny ref '%s' locally" ,
1766
+ error (_ ( "* Ignoring funny ref '%s' locally" ) ,
1767
1767
(* rmp )-> peer_ref -> name );
1768
1768
* rmp = (* rmp )-> next ;
1769
1769
free (ignore -> peer_ref );
@@ -1858,7 +1858,7 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
1858
1858
repo_init_revisions (the_repository , & revs , NULL );
1859
1859
setup_revisions (argv .argc , argv .argv , & revs , NULL );
1860
1860
if (prepare_revision_walk (& revs ))
1861
- die ("revision walk setup failed" );
1861
+ die (_ ( "revision walk setup failed" ) );
1862
1862
1863
1863
/* ... and count the commits on each side. */
1864
1864
while (1 ) {
@@ -2131,7 +2131,8 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
2131
2131
else if (!colon [1 ])
2132
2132
oidclr (& entry -> expect );
2133
2133
else if (get_oid (colon + 1 , & entry -> expect ))
2134
- return error ("cannot parse expected object name '%s'" , colon + 1 );
2134
+ return error (_ ("cannot parse expected object name '%s'" ),
2135
+ colon + 1 );
2135
2136
return 0 ;
2136
2137
}
2137
2138
0 commit comments