@@ -78,7 +78,7 @@ int server_supports_v2(const char *c, int die_on_error)
78
78
}
79
79
80
80
if (die_on_error )
81
- die ("server doesn't support '%s'" , c );
81
+ die (_ ( "server doesn't support '%s'" ) , c );
82
82
83
83
return 0 ;
84
84
}
@@ -100,7 +100,7 @@ int server_supports_feature(const char *c, const char *feature,
100
100
}
101
101
102
102
if (die_on_error )
103
- die ("server doesn't support feature '%s'" , feature );
103
+ die (_ ( "server doesn't support feature '%s'" ) , feature );
104
104
105
105
return 0 ;
106
106
}
@@ -111,7 +111,7 @@ static void process_capabilities_v2(struct packet_reader *reader)
111
111
argv_array_push (& server_capabilities_v2 , reader -> line );
112
112
113
113
if (reader -> status != PACKET_READ_FLUSH )
114
- die ("expected flush after capabilities" );
114
+ die (_ ( "expected flush after capabilities" ) );
115
115
}
116
116
117
117
enum protocol_version discover_version (struct packet_reader * reader )
@@ -230,7 +230,7 @@ static int process_dummy_ref(const char *line)
230
230
static void check_no_capabilities (const char * line , int len )
231
231
{
232
232
if (strlen (line ) != len )
233
- warning ("ignoring capabilities after first line '%s'" ,
233
+ warning (_ ( "ignoring capabilities after first line '%s'" ) ,
234
234
line + strlen (line ));
235
235
}
236
236
@@ -249,7 +249,7 @@ static int process_ref(const char *line, int len, struct ref ***list,
249
249
if (extra_have && !strcmp (name , ".have" )) {
250
250
oid_array_append (extra_have , & old_oid );
251
251
} else if (!strcmp (name , "capabilities^{}" )) {
252
- die ("protocol error: unexpected capabilities^{}" );
252
+ die (_ ( "protocol error: unexpected capabilities^{}" ) );
253
253
} else if (check_ref (name , flags )) {
254
254
struct ref * ref = alloc_ref (name );
255
255
oidcpy (& ref -> old_oid , & old_oid );
@@ -270,9 +270,9 @@ static int process_shallow(const char *line, int len,
270
270
return 0 ;
271
271
272
272
if (get_oid_hex (arg , & old_oid ))
273
- die ("protocol error: expected shallow sha-1, got '%s'" , arg );
273
+ die (_ ( "protocol error: expected shallow sha-1, got '%s'" ) , arg );
274
274
if (!shallow_points )
275
- die ("repository on the other end cannot be shallow" );
275
+ die (_ ( "repository on the other end cannot be shallow" ) );
276
276
oid_array_append (shallow_points , & old_oid );
277
277
check_no_capabilities (line , len );
278
278
return 1 ;
@@ -307,13 +307,13 @@ struct ref **get_remote_heads(struct packet_reader *reader,
307
307
case PACKET_READ_NORMAL :
308
308
len = reader -> pktlen ;
309
309
if (len > 4 && skip_prefix (reader -> line , "ERR " , & arg ))
310
- die ("remote error: %s" , arg );
310
+ die (_ ( "remote error: %s" ) , arg );
311
311
break ;
312
312
case PACKET_READ_FLUSH :
313
313
state = EXPECTING_DONE ;
314
314
break ;
315
315
case PACKET_READ_DELIM :
316
- die ("invalid packet" );
316
+ die (_ ( "invalid packet" ) );
317
317
}
318
318
319
319
switch (state ) {
@@ -333,7 +333,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,
333
333
case EXPECTING_SHALLOW :
334
334
if (process_shallow (reader -> line , len , shallow_points ))
335
335
break ;
336
- die ("protocol error: unexpected '%s'" , reader -> line );
336
+ die (_ ( "protocol error: unexpected '%s'" ) , reader -> line );
337
337
case EXPECTING_DONE :
338
338
break ;
339
339
}
@@ -441,11 +441,11 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
441
441
/* Process response from server */
442
442
while (packet_reader_read (reader ) == PACKET_READ_NORMAL ) {
443
443
if (!process_ref_v2 (reader -> line , & list ))
444
- die ("invalid ls-refs response: %s" , reader -> line );
444
+ die (_ ( "invalid ls-refs response: %s" ) , reader -> line );
445
445
}
446
446
447
447
if (reader -> status != PACKET_READ_FLUSH )
448
- die ("expected flush after ref listing" );
448
+ die (_ ( "expected flush after ref listing" ) );
449
449
450
450
return list ;
451
451
}
@@ -544,7 +544,7 @@ static enum protocol get_protocol(const char *name)
544
544
return PROTO_SSH ;
545
545
if (!strcmp (name , "file" ))
546
546
return PROTO_FILE ;
547
- die ("protocol '%s' is not supported" , name );
547
+ die (_ ( "protocol '%s' is not supported" ) , name );
548
548
}
549
549
550
550
static char * host_end (char * * hoststart , int removebrackets )
@@ -595,7 +595,7 @@ static void enable_keepalive(int sockfd)
595
595
int ka = 1 ;
596
596
597
597
if (setsockopt (sockfd , SOL_SOCKET , SO_KEEPALIVE , & ka , sizeof (ka )) < 0 )
598
- error_errno ("unable to set SO_KEEPALIVE on socket" );
598
+ error_errno (_ ( "unable to set SO_KEEPALIVE on socket" ) );
599
599
}
600
600
601
601
#ifndef NO_IPV6
@@ -635,14 +635,15 @@ static int git_tcp_connect_sock(char *host, int flags)
635
635
hints .ai_protocol = IPPROTO_TCP ;
636
636
637
637
if (flags & CONNECT_VERBOSE )
638
- fprintf (stderr , "Looking up %s ... " , host );
638
+ fprintf (stderr , _ ( "Looking up %s ... " ) , host );
639
639
640
640
gai = getaddrinfo (host , port , & hints , & ai );
641
641
if (gai )
642
- die ("unable to look up %s (port %s) (%s)" , host , port , gai_strerror (gai ));
642
+ die (_ ( "unable to look up %s (port %s) (%s)" ) , host , port , gai_strerror (gai ));
643
643
644
644
if (flags & CONNECT_VERBOSE )
645
- fprintf (stderr , "done.\nConnecting to %s (port %s) ... " , host , port );
645
+ /* TRANSLATORS: this is the end of "Looking up %s ... " */
646
+ fprintf (stderr , _ ("done.\nConnecting to %s (port %s) ... " ), host , port );
646
647
647
648
for (ai0 = ai ; ai ; ai = ai -> ai_next , cnt ++ ) {
648
649
sockfd = socket (ai -> ai_family ,
@@ -664,12 +665,13 @@ static int git_tcp_connect_sock(char *host, int flags)
664
665
freeaddrinfo (ai0 );
665
666
666
667
if (sockfd < 0 )
667
- die ("unable to connect to %s:\n%s" , host , error_message .buf );
668
+ die (_ ( "unable to connect to %s:\n%s" ) , host , error_message .buf );
668
669
669
670
enable_keepalive (sockfd );
670
671
671
672
if (flags & CONNECT_VERBOSE )
672
- fprintf_ln (stderr , "done." );
673
+ /* TRANSLATORS: this is the end of "Connecting to %s (port %s) ... " */
674
+ fprintf_ln (stderr , _ ("done." ));
673
675
674
676
strbuf_release (& error_message );
675
677
@@ -696,22 +698,23 @@ static int git_tcp_connect_sock(char *host, int flags)
696
698
get_host_and_port (& host , & port );
697
699
698
700
if (flags & CONNECT_VERBOSE )
699
- fprintf (stderr , "Looking up %s ... " , host );
701
+ fprintf (stderr , _ ( "Looking up %s ... " ) , host );
700
702
701
703
he = gethostbyname (host );
702
704
if (!he )
703
- die ("unable to look up %s (%s)" , host , hstrerror (h_errno ));
705
+ die (_ ( "unable to look up %s (%s)" ) , host , hstrerror (h_errno ));
704
706
nport = strtoul (port , & ep , 10 );
705
707
if ( ep == port || * ep ) {
706
708
/* Not numeric */
707
709
struct servent * se = getservbyname (port ,"tcp" );
708
710
if ( !se )
709
- die ("unknown port %s" , port );
711
+ die (_ ( "unknown port %s" ) , port );
710
712
nport = se -> s_port ;
711
713
}
712
714
713
715
if (flags & CONNECT_VERBOSE )
714
- fprintf (stderr , "done.\nConnecting to %s (port %s) ... " , host , port );
716
+ /* TRANSLATORS: this is the end of "Looking up %s ... " */
717
+ fprintf (stderr , _ ("done.\nConnecting to %s (port %s) ... " ), host , port );
715
718
716
719
for (cnt = 0 , ap = he -> h_addr_list ; * ap ; ap ++ , cnt ++ ) {
717
720
memset (& sa , 0 , sizeof sa );
@@ -739,12 +742,13 @@ static int git_tcp_connect_sock(char *host, int flags)
739
742
}
740
743
741
744
if (sockfd < 0 )
742
- die ("unable to connect to %s:\n%s" , host , error_message .buf );
745
+ die (_ ( "unable to connect to %s:\n%s" ) , host , error_message .buf );
743
746
744
747
enable_keepalive (sockfd );
745
748
746
749
if (flags & CONNECT_VERBOSE )
747
- fprintf_ln (stderr , "done." );
750
+ /* TRANSLATORS: this is the end of "Connecting to %s (port %s) ... " */
751
+ fprintf_ln (stderr , _ ("done." ));
748
752
749
753
return sockfd ;
750
754
}
@@ -841,9 +845,9 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
841
845
get_host_and_port (& host , & port );
842
846
843
847
if (looks_like_command_line_option (host ))
844
- die ("strange hostname '%s' blocked" , host );
848
+ die (_ ( "strange hostname '%s' blocked" ) , host );
845
849
if (looks_like_command_line_option (port ))
846
- die ("strange port '%s' blocked" , port );
850
+ die (_ ( "strange port '%s' blocked" ) , port );
847
851
848
852
proxy = xmalloc (sizeof (* proxy ));
849
853
child_process_init (proxy );
@@ -853,7 +857,7 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
853
857
proxy -> in = -1 ;
854
858
proxy -> out = -1 ;
855
859
if (start_command (proxy ))
856
- die ("cannot start proxy %s" , git_proxy_command );
860
+ die (_ ( "cannot start proxy %s" ) , git_proxy_command );
857
861
fd [0 ] = proxy -> out ; /* read from proxy stdout */
858
862
fd [1 ] = proxy -> in ; /* write to proxy stdin */
859
863
return proxy ;
@@ -920,7 +924,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,
920
924
path = strchr (end , separator );
921
925
922
926
if (!path || !* path )
923
- die ("no path specified; see 'git help pull' for valid url syntax" );
927
+ die (_ ( "no path specified; see 'git help pull' for valid url syntax" ) );
924
928
925
929
/*
926
930
* null-terminate hostname and point path to ~ for URL's like this:
@@ -1115,7 +1119,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
1115
1119
case VARIANT_AUTO :
1116
1120
BUG ("VARIANT_AUTO passed to push_ssh_options" );
1117
1121
case VARIANT_SIMPLE :
1118
- die ("ssh variant 'simple' does not support -4" );
1122
+ die (_ ( "ssh variant 'simple' does not support -4" ) );
1119
1123
case VARIANT_SSH :
1120
1124
case VARIANT_PLINK :
1121
1125
case VARIANT_PUTTY :
@@ -1127,7 +1131,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
1127
1131
case VARIANT_AUTO :
1128
1132
BUG ("VARIANT_AUTO passed to push_ssh_options" );
1129
1133
case VARIANT_SIMPLE :
1130
- die ("ssh variant 'simple' does not support -6" );
1134
+ die (_ ( "ssh variant 'simple' does not support -6" ) );
1131
1135
case VARIANT_SSH :
1132
1136
case VARIANT_PLINK :
1133
1137
case VARIANT_PUTTY :
@@ -1144,7 +1148,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
1144
1148
case VARIANT_AUTO :
1145
1149
BUG ("VARIANT_AUTO passed to push_ssh_options" );
1146
1150
case VARIANT_SIMPLE :
1147
- die ("ssh variant 'simple' does not support setting port" );
1151
+ die (_ ( "ssh variant 'simple' does not support setting port" ) );
1148
1152
case VARIANT_SSH :
1149
1153
argv_array_push (args , "-p" );
1150
1154
break ;
@@ -1167,7 +1171,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
1167
1171
enum ssh_variant variant ;
1168
1172
1169
1173
if (looks_like_command_line_option (ssh_host ))
1170
- die ("strange hostname '%s' blocked" , ssh_host );
1174
+ die (_ ( "strange hostname '%s' blocked" ) , ssh_host );
1171
1175
1172
1176
ssh = get_ssh_command ();
1173
1177
if (ssh ) {
@@ -1255,7 +1259,7 @@ struct child_process *git_connect(int fd[2], const char *url,
1255
1259
child_process_init (conn );
1256
1260
1257
1261
if (looks_like_command_line_option (path ))
1258
- die ("strange pathname '%s' blocked" , path );
1262
+ die (_ ( "strange pathname '%s' blocked" ) , path );
1259
1263
1260
1264
strbuf_addstr (& cmd , prog );
1261
1265
strbuf_addch (& cmd , ' ' );
@@ -1300,7 +1304,7 @@ struct child_process *git_connect(int fd[2], const char *url,
1300
1304
argv_array_push (& conn -> args , cmd .buf );
1301
1305
1302
1306
if (start_command (conn ))
1303
- die ("unable to fork" );
1307
+ die (_ ( "unable to fork" ) );
1304
1308
1305
1309
fd [0 ] = conn -> out ; /* read from child's stdout */
1306
1310
fd [1 ] = conn -> in ; /* write to child's stdin */
0 commit comments