@@ -208,7 +208,7 @@ static void consume_shallow_list(struct fetch_pack_args *args, int fd)
208
208
continue ;
209
209
if (starts_with (line , "unshallow " ))
210
210
continue ;
211
- die ("git fetch-pack: expected shallow list" );
211
+ die (_ ( "git fetch-pack: expected shallow list" ) );
212
212
}
213
213
}
214
214
}
@@ -220,7 +220,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
220
220
const char * arg ;
221
221
222
222
if (!len )
223
- die ("git fetch-pack: expected ACK/NAK, got EOF" );
223
+ die (_ ( "git fetch-pack: expected ACK/NAK, got EOF" ) );
224
224
if (!strcmp (line , "NAK" ))
225
225
return NAK ;
226
226
if (skip_prefix (line , "ACK " , & arg )) {
@@ -238,7 +238,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
238
238
return ACK ;
239
239
}
240
240
}
241
- die ("git fetch_pack: expected ACK/NAK, got '%s'" , line );
241
+ die (_ ( "git fetch_pack: expected ACK/NAK, got '%s'" ) , line );
242
242
}
243
243
244
244
static void send_request (struct fetch_pack_args * args ,
@@ -285,7 +285,7 @@ static int find_common(struct fetch_pack_args *args,
285
285
size_t state_len = 0 ;
286
286
287
287
if (args -> stateless_rpc && multi_ack == 1 )
288
- die ("--stateless-rpc requires multi_ack_detailed" );
288
+ die (_ ( "--stateless-rpc requires multi_ack_detailed" ) );
289
289
if (marked )
290
290
for_each_ref (clear_marks , NULL );
291
291
marked = 1 ;
@@ -357,23 +357,23 @@ static int find_common(struct fetch_pack_args *args,
357
357
while ((line = packet_read_line (fd [0 ], NULL ))) {
358
358
if (skip_prefix (line , "shallow " , & arg )) {
359
359
if (get_sha1_hex (arg , sha1 ))
360
- die ("invalid shallow line: %s" , line );
360
+ die (_ ( "invalid shallow line: %s" ) , line );
361
361
register_shallow (sha1 );
362
362
continue ;
363
363
}
364
364
if (skip_prefix (line , "unshallow " , & arg )) {
365
365
if (get_sha1_hex (arg , sha1 ))
366
- die ("invalid unshallow line: %s" , line );
366
+ die (_ ( "invalid unshallow line: %s" ) , line );
367
367
if (!lookup_object (sha1 ))
368
- die ("object not found: %s" , line );
368
+ die (_ ( "object not found: %s" ) , line );
369
369
/* make sure that it is parsed as shallow */
370
370
if (!parse_object (sha1 ))
371
- die ("error in object: %s" , line );
371
+ die (_ ( "error in object: %s" ) , line );
372
372
if (unregister_shallow (sha1 ))
373
- die ("no shallow found: %s" , line );
373
+ die (_ ( "no shallow found: %s" ) , line );
374
374
continue ;
375
375
}
376
- die ("expected shallow/unshallow, got %s" , line );
376
+ die (_ ( "expected shallow/unshallow, got %s" ) , line );
377
377
}
378
378
} else if (!args -> stateless_rpc )
379
379
send_request (args , fd [1 ], & req_buf );
@@ -412,8 +412,8 @@ static int find_common(struct fetch_pack_args *args,
412
412
do {
413
413
ack = get_ack (fd [0 ], result_sha1 );
414
414
if (ack )
415
- print_verbose (args , "got ack %d %s" , ack ,
416
- sha1_to_hex (result_sha1 ));
415
+ print_verbose (args , _ ( "got %s %d %s" ), " ack" ,
416
+ ack , sha1_to_hex (result_sha1 ));
417
417
switch (ack ) {
418
418
case ACK :
419
419
flushes = 0 ;
@@ -426,7 +426,7 @@ static int find_common(struct fetch_pack_args *args,
426
426
struct commit * commit =
427
427
lookup_commit (result_sha1 );
428
428
if (!commit )
429
- die ("invalid commit %s" , sha1_to_hex (result_sha1 ));
429
+ die (_ ( "invalid commit %s" ) , sha1_to_hex (result_sha1 ));
430
430
if (args -> stateless_rpc
431
431
&& ack == ACK_common
432
432
&& !(commit -> object .flags & COMMON )) {
@@ -452,7 +452,7 @@ static int find_common(struct fetch_pack_args *args,
452
452
} while (ack );
453
453
flushes -- ;
454
454
if (got_continue && MAX_IN_VAIN < in_vain ) {
455
- print_verbose (args , "giving up" );
455
+ print_verbose (args , _ ( "giving up" ) );
456
456
break ; /* give up */
457
457
}
458
458
}
@@ -462,7 +462,7 @@ static int find_common(struct fetch_pack_args *args,
462
462
packet_buf_write (& req_buf , "done\n" );
463
463
send_request (args , fd [1 ], & req_buf );
464
464
}
465
- print_verbose (args , "done" );
465
+ print_verbose (args , _ ( "done" ) );
466
466
if (retval != 0 ) {
467
467
multi_ack = 0 ;
468
468
flushes ++ ;
@@ -474,8 +474,8 @@ static int find_common(struct fetch_pack_args *args,
474
474
while (flushes || multi_ack ) {
475
475
int ack = get_ack (fd [0 ], result_sha1 );
476
476
if (ack ) {
477
- print_verbose (args , "got ack (%d) %s" , ack ,
478
- sha1_to_hex (result_sha1 ));
477
+ print_verbose (args , _ ( "got %s (%d) %s" ), " ack" ,
478
+ ack , sha1_to_hex (result_sha1 ));
479
479
if (ack == ACK )
480
480
return 0 ;
481
481
multi_ack = 1 ;
@@ -520,7 +520,7 @@ static void mark_recent_complete_commits(struct fetch_pack_args *args,
520
520
unsigned long cutoff )
521
521
{
522
522
while (complete && cutoff <= complete -> item -> date ) {
523
- print_verbose (args , "Marking %s as complete" ,
523
+ print_verbose (args , _ ( "Marking %s as complete" ) ,
524
524
oid_to_hex (& complete -> item -> object .oid ));
525
525
pop_most_recent_commit (& complete , COMPLETE );
526
526
}
@@ -666,7 +666,7 @@ static int everything_local(struct fetch_pack_args *args,
666
666
ref -> name );
667
667
continue ;
668
668
}
669
- print_verbose (args , "already have %s (%s)" , sha1_to_hex (remote ),
669
+ print_verbose (args , _ ( "already have %s (%s)" ) , sha1_to_hex (remote ),
670
670
ref -> name );
671
671
}
672
672
return retval ;
@@ -702,16 +702,15 @@ static int get_pack(struct fetch_pack_args *args,
702
702
demux .data = xd ;
703
703
demux .out = -1 ;
704
704
if (start_async (& demux ))
705
- die ("fetch-pack: unable to fork off sideband"
706
- " demultiplexer" );
705
+ die (_ ("fetch-pack: unable to fork off sideband demultiplexer" ));
707
706
}
708
707
else
709
708
demux .out = xd [0 ];
710
709
711
710
if (!args -> keep_pack && unpack_limit ) {
712
711
713
712
if (read_pack_header (demux .out , & header ))
714
- die ("protocol error: bad pack header" );
713
+ die (_ ( "protocol error: bad pack header" ) );
715
714
pass_header = 1 ;
716
715
if (ntohl (header .hdr_entries ) < unpack_limit )
717
716
do_keep = 0 ;
@@ -767,7 +766,7 @@ static int get_pack(struct fetch_pack_args *args,
767
766
cmd .in = demux .out ;
768
767
cmd .git_cmd = 1 ;
769
768
if (start_command (& cmd ))
770
- die ("fetch-pack: unable to fork off %s" , cmd_name );
769
+ die (_ ( "fetch-pack: unable to fork off %s" ) , cmd_name );
771
770
if (do_keep && pack_lockfile ) {
772
771
* pack_lockfile = index_pack_lockfile (cmd .out );
773
772
close (cmd .out );
@@ -783,9 +782,9 @@ static int get_pack(struct fetch_pack_args *args,
783
782
args -> check_self_contained_and_connected &&
784
783
ret == 0 ;
785
784
else
786
- die ("%s failed" , cmd_name );
785
+ die (_ ( "%s failed" ) , cmd_name );
787
786
if (use_sideband && finish_async (& demux ))
788
- die ("error in sideband demultiplexer" );
787
+ die (_ ( "error in sideband demultiplexer" ) );
789
788
return 0 ;
790
789
}
791
790
@@ -812,34 +811,34 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
812
811
qsort (sought , nr_sought , sizeof (* sought ), cmp_ref_by_name );
813
812
814
813
if ((args -> depth > 0 || is_repository_shallow ()) && !server_supports ("shallow" ))
815
- die ("Server does not support shallow clients" );
814
+ die (_ ( "Server does not support shallow clients" ) );
816
815
if (server_supports ("multi_ack_detailed" )) {
817
- print_verbose (args , "Server supports multi_ack_detailed" );
816
+ print_verbose (args , _ ( "Server supports multi_ack_detailed" ) );
818
817
multi_ack = 2 ;
819
818
if (server_supports ("no-done" )) {
820
- print_verbose (args , "Server supports no-done" );
819
+ print_verbose (args , _ ( "Server supports no-done" ) );
821
820
if (args -> stateless_rpc )
822
821
no_done = 1 ;
823
822
}
824
823
}
825
824
else if (server_supports ("multi_ack" )) {
826
- print_verbose (args , "Server supports multi_ack" );
825
+ print_verbose (args , _ ( "Server supports multi_ack" ) );
827
826
multi_ack = 1 ;
828
827
}
829
828
if (server_supports ("side-band-64k" )) {
830
- print_verbose (args , "Server supports side-band-64k" );
829
+ print_verbose (args , _ ( "Server supports side-band-64k" ) );
831
830
use_sideband = 2 ;
832
831
}
833
832
else if (server_supports ("side-band" )) {
834
- print_verbose (args , "Server supports side-band" );
833
+ print_verbose (args , _ ( "Server supports side-band" ) );
835
834
use_sideband = 1 ;
836
835
}
837
836
if (server_supports ("allow-tip-sha1-in-want" )) {
838
- print_verbose (args , "Server supports allow-tip-sha1-in-want" );
837
+ print_verbose (args , _ ( "Server supports allow-tip-sha1-in-want" ) );
839
838
allow_unadvertised_object_request |= ALLOW_TIP_SHA1 ;
840
839
}
841
840
if (server_supports ("allow-reachable-sha1-in-want" )) {
842
- print_verbose (args , "Server supports allow-reachable-sha1-in-want" );
841
+ print_verbose (args , _ ( "Server supports allow-reachable-sha1-in-want" ) );
843
842
allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1 ;
844
843
}
845
844
if (!server_supports ("thin-pack" ))
@@ -849,14 +848,14 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
849
848
if (!server_supports ("include-tag" ))
850
849
args -> include_tag = 0 ;
851
850
if (server_supports ("ofs-delta" ))
852
- print_verbose (args , "Server supports ofs-delta" );
851
+ print_verbose (args , _ ( "Server supports ofs-delta" ) );
853
852
else
854
853
prefer_ofs_delta = 0 ;
855
854
856
855
if ((agent_feature = server_feature_value ("agent" , & agent_len ))) {
857
856
agent_supported = 1 ;
858
857
if (agent_len )
859
- print_verbose (args , "Server version is %.*s" ,
858
+ print_verbose (args , _ ( "Server version is %.*s" ) ,
860
859
agent_len , agent_feature );
861
860
}
862
861
@@ -869,7 +868,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
869
868
/* When cloning, it is not unusual to have
870
869
* no common commit.
871
870
*/
872
- warning ("no common commits" );
871
+ warning (_ ( "no common commits" ) );
873
872
874
873
if (args -> stateless_rpc )
875
874
packet_flush (fd [1 ]);
@@ -881,7 +880,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
881
880
else
882
881
alternate_shallow_file = NULL ;
883
882
if (get_pack (args , fd , pack_lockfile ))
884
- die ("git fetch-pack: fetch failed." );
883
+ die (_ ( "git fetch-pack: fetch failed." ) );
885
884
886
885
all_done :
887
886
return ref ;
@@ -1043,7 +1042,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
1043
1042
1044
1043
if (!ref ) {
1045
1044
packet_flush (fd [1 ]);
1046
- die ("no matching remote head" );
1045
+ die (_ ( "no matching remote head" ) );
1047
1046
}
1048
1047
prepare_shallow_info (& si , shallow );
1049
1048
ref_cpy = do_fetch_pack (args , fd , ref , sought , nr_sought ,
0 commit comments