@@ -154,7 +154,7 @@ static int set_option(const char *name, const char *value)
154
154
else {
155
155
struct strbuf unquoted = STRBUF_INIT ;
156
156
if (unquote_c_style (& unquoted , value , NULL ) < 0 )
157
- die ("invalid quoting in push-option value" );
157
+ die (_ ( "invalid quoting in push-option value: '%s'" ), value );
158
158
string_list_append_nodup (& options .push_options ,
159
159
strbuf_detach (& unquoted , NULL ));
160
160
}
@@ -251,7 +251,7 @@ static struct ref *parse_info_refs(struct discovery *heads)
251
251
mid = & data [i ];
252
252
if (data [i ] == '\n' ) {
253
253
if (mid - start != 40 )
254
- die ("%sinfo/refs not valid: is this a git repository?" ,
254
+ die (_ ( "%sinfo/refs not valid: is this a git repository?" ) ,
255
255
transport_anonymize_url (url .buf ));
256
256
data [i ] = 0 ;
257
257
ref_name = mid + 1 ;
@@ -365,7 +365,7 @@ static void check_smart_http(struct discovery *d, const char *service,
365
365
PACKET_READ_CHOMP_NEWLINE |
366
366
PACKET_READ_DIE_ON_ERR_PACKET );
367
367
if (packet_reader_read (& reader ) != PACKET_READ_NORMAL )
368
- die ("invalid server response; expected service, got flush packet" );
368
+ die (_ ( "invalid server response; expected service, got flush packet" ) );
369
369
370
370
if (skip_prefix (reader .line , "# service=" , & p ) && !strcmp (p , service )) {
371
371
/*
@@ -396,7 +396,7 @@ static void check_smart_http(struct discovery *d, const char *service,
396
396
d -> proto_git = 1 ;
397
397
398
398
} else {
399
- die ("invalid server response; got '%s'" , reader .line );
399
+ die (_ ( "invalid server response; got '%s'" ) , reader .line );
400
400
}
401
401
}
402
402
@@ -450,15 +450,15 @@ static struct discovery *discover_refs(const char *service, int for_push)
450
450
break ;
451
451
case HTTP_MISSING_TARGET :
452
452
show_http_message (& type , & charset , & buffer );
453
- die ("repository '%s' not found" ,
453
+ die (_ ( "repository '%s' not found" ) ,
454
454
transport_anonymize_url (url .buf ));
455
455
case HTTP_NOAUTH :
456
456
show_http_message (& type , & charset , & buffer );
457
- die ("Authentication failed for '%s'" ,
457
+ die (_ ( "Authentication failed for '%s'" ) ,
458
458
transport_anonymize_url (url .buf ));
459
459
default :
460
460
show_http_message (& type , & charset , & buffer );
461
- die ("unable to access '%s': %s" ,
461
+ die (_ ( "unable to access '%s': %s" ) ,
462
462
transport_anonymize_url (url .buf ), curl_errorstr );
463
463
}
464
464
@@ -588,7 +588,7 @@ static int rpc_read_from_out(struct rpc_state *rpc, int options,
588
588
switch (* status ) {
589
589
case PACKET_READ_EOF :
590
590
if (!(options & PACKET_READ_GENTLE_ON_EOF ))
591
- die ("shouldn't have EOF when not gentle on EOF" );
591
+ die (_ ( "shouldn't have EOF when not gentle on EOF" ) );
592
592
break ;
593
593
case PACKET_READ_NORMAL :
594
594
set_packet_header (buf - 4 , * appended );
@@ -668,7 +668,7 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
668
668
rpc -> pos = 0 ;
669
669
return CURLIOE_OK ;
670
670
}
671
- error ("unable to rewind rpc post data - try increasing http.postBuffer" );
671
+ error (_ ( "unable to rewind rpc post data - try increasing http.postBuffer" ) );
672
672
return CURLIOE_FAILRESTART ;
673
673
674
674
default :
@@ -728,7 +728,7 @@ static int run_slot(struct active_request_slot *slot,
728
728
strbuf_addstr (& msg , curl_errorstr );
729
729
}
730
730
}
731
- error ("RPC failed; %s" , msg .buf );
731
+ error (_ ( "RPC failed; %s" ) , msg .buf );
732
732
strbuf_release (& msg );
733
733
}
734
734
@@ -768,7 +768,7 @@ static curl_off_t xcurl_off_t(size_t len)
768
768
{
769
769
uintmax_t size = len ;
770
770
if (size > maximum_signed_value_of_type (curl_off_t ))
771
- die ("cannot handle pushes this big" );
771
+ die (_ ( "cannot handle pushes this big" ) );
772
772
return (curl_off_t )size ;
773
773
}
774
774
@@ -883,11 +883,11 @@ static int post_rpc(struct rpc_state *rpc, int flush_received)
883
883
884
884
ret = git_deflate (& stream , Z_FINISH );
885
885
if (ret != Z_STREAM_END )
886
- die ("cannot deflate request; zlib deflate error %d" , ret );
886
+ die (_ ( "cannot deflate request; zlib deflate error %d" ) , ret );
887
887
888
888
ret = git_deflate_end_gently (& stream );
889
889
if (ret != Z_OK )
890
- die ("cannot deflate request; zlib end error %d" , ret );
890
+ die (_ ( "cannot deflate request; zlib end error %d" ) , ret );
891
891
892
892
gzip_size = stream .total_out ;
893
893
@@ -1018,7 +1018,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
1018
1018
1019
1019
ALLOC_ARRAY (targets , nr_heads );
1020
1020
if (options .depth || options .deepen_since )
1021
- die ("dumb http transport does not support shallow capabilities" );
1021
+ die (_ ( "dumb http transport does not support shallow capabilities" ) );
1022
1022
for (i = 0 ; i < nr_heads ; i ++ )
1023
1023
targets [i ] = xstrdup (oid_to_hex (& to_fetch [i ]-> old_oid ));
1024
1024
@@ -1032,7 +1032,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
1032
1032
free (targets [i ]);
1033
1033
free (targets );
1034
1034
1035
- return ret ? error ("fetch failed." ) : 0 ;
1035
+ return ret ? error (_ ( "fetch failed." ) ) : 0 ;
1036
1036
}
1037
1037
1038
1038
static int fetch_git (struct discovery * heads ,
@@ -1080,7 +1080,7 @@ static int fetch_git(struct discovery *heads,
1080
1080
for (i = 0 ; i < nr_heads ; i ++ ) {
1081
1081
struct ref * ref = to_fetch [i ];
1082
1082
if (!* ref -> name )
1083
- die ("cannot fetch by sha1 over smart http" );
1083
+ die (_ ( "cannot fetch by sha1 over smart http" ) );
1084
1084
packet_buf_write (& preamble , "%s %s\n" ,
1085
1085
oid_to_hex (& ref -> old_oid ), ref -> name );
1086
1086
}
@@ -1123,13 +1123,13 @@ static void parse_fetch(struct strbuf *buf)
1123
1123
struct object_id old_oid ;
1124
1124
1125
1125
if (get_oid_hex (p , & old_oid ))
1126
- die ("protocol error: expected sha/ref, got %s'" , p );
1126
+ die (_ ( "protocol error: expected sha/ref, got %s'" ) , p );
1127
1127
if (p [GIT_SHA1_HEXSZ ] == ' ' )
1128
1128
name = p + GIT_SHA1_HEXSZ + 1 ;
1129
1129
else if (!p [GIT_SHA1_HEXSZ ])
1130
1130
name = "" ;
1131
1131
else
1132
- die ("protocol error: expected sha/ref, got %s'" , p );
1132
+ die (_ ( "protocol error: expected sha/ref, got %s'" ) , p );
1133
1133
1134
1134
ref = alloc_ref (name );
1135
1135
oidcpy (& ref -> old_oid , & old_oid );
@@ -1141,7 +1141,7 @@ static void parse_fetch(struct strbuf *buf)
1141
1141
to_fetch [nr_heads ++ ] = ref ;
1142
1142
}
1143
1143
else
1144
- die ("http transport does not support %s" , buf -> buf );
1144
+ die (_ ( "http transport does not support %s" ) , buf -> buf );
1145
1145
1146
1146
strbuf_reset (buf );
1147
1147
if (strbuf_getline_lf (buf , stdin ) == EOF )
@@ -1177,7 +1177,7 @@ static int push_dav(int nr_spec, char **specs)
1177
1177
argv_array_push (& child .args , specs [i ]);
1178
1178
1179
1179
if (run_command (& child ))
1180
- die ("git-http-push failed" );
1180
+ die (_ ( "git-http-push failed" ) );
1181
1181
return 0 ;
1182
1182
}
1183
1183
@@ -1255,7 +1255,7 @@ static void parse_push(struct strbuf *buf)
1255
1255
specs [nr_spec ++ ] = xstrdup (buf -> buf + 5 );
1256
1256
}
1257
1257
else
1258
- die ("http transport does not support %s" , buf -> buf );
1258
+ die (_ ( "http transport does not support %s" ) , buf -> buf );
1259
1259
1260
1260
strbuf_reset (buf );
1261
1261
if (strbuf_getline_lf (buf , stdin ) == EOF )
@@ -1365,7 +1365,7 @@ int cmd_main(int argc, const char **argv)
1365
1365
1366
1366
setup_git_directory_gently (& nongit );
1367
1367
if (argc < 2 ) {
1368
- error ("remote-curl: usage: git remote-curl <remote> [<url>]" );
1368
+ error (_ ( "remote-curl: usage: git remote-curl <remote> [<url>]" ) );
1369
1369
return 1 ;
1370
1370
}
1371
1371
@@ -1397,14 +1397,14 @@ int cmd_main(int argc, const char **argv)
1397
1397
1398
1398
if (strbuf_getline_lf (& buf , stdin ) == EOF ) {
1399
1399
if (ferror (stdin ))
1400
- error ("remote-curl: error reading command stream from git" );
1400
+ error (_ ( "remote-curl: error reading command stream from git" ) );
1401
1401
return 1 ;
1402
1402
}
1403
1403
if (buf .len == 0 )
1404
1404
break ;
1405
1405
if (starts_with (buf .buf , "fetch " )) {
1406
1406
if (nongit )
1407
- die ("remote-curl: fetch attempted without a local repo" );
1407
+ die (_ ( "remote-curl: fetch attempted without a local repo" ) );
1408
1408
parse_fetch (& buf );
1409
1409
1410
1410
} else if (!strcmp (buf .buf , "list" ) || starts_with (buf .buf , "list " )) {
@@ -1444,7 +1444,7 @@ int cmd_main(int argc, const char **argv)
1444
1444
if (!stateless_connect (arg ))
1445
1445
break ;
1446
1446
} else {
1447
- error ("remote-curl: unknown command '%s' from git" , buf .buf );
1447
+ error (_ ( "remote-curl: unknown command '%s' from git" ) , buf .buf );
1448
1448
return 1 ;
1449
1449
}
1450
1450
strbuf_reset (& buf );
0 commit comments