1
1
#define USE_THE_REPOSITORY_VARIABLE
2
- #define DISABLE_SIGN_COMPARE_WARNINGS
3
2
4
3
#include "git-compat-util.h"
5
4
#include "config.h"
@@ -77,7 +76,7 @@ static NORETURN void die_initial_contact(int unexpected)
77
76
/* Checks if the server supports the capability 'c' */
78
77
int server_supports_v2 (const char * c )
79
78
{
80
- int i ;
79
+ size_t i ;
81
80
82
81
for (i = 0 ; i < server_capabilities_v2 .nr ; i ++ ) {
83
82
const char * out ;
@@ -96,7 +95,7 @@ void ensure_server_supports_v2(const char *c)
96
95
97
96
int server_feature_v2 (const char * c , const char * * v )
98
97
{
99
- int i ;
98
+ size_t i ;
100
99
101
100
for (i = 0 ; i < server_capabilities_v2 .nr ; i ++ ) {
102
101
const char * out ;
@@ -112,7 +111,7 @@ int server_feature_v2(const char *c, const char **v)
112
111
int server_supports_feature (const char * c , const char * feature ,
113
112
int die_on_error )
114
113
{
115
- int i ;
114
+ size_t i ;
116
115
117
116
for (i = 0 ; i < server_capabilities_v2 .nr ; i ++ ) {
118
117
const char * out ;
@@ -232,12 +231,12 @@ static void annotate_refs_with_symref_info(struct ref *ref)
232
231
string_list_clear (& symref , 0 );
233
232
}
234
233
235
- static void process_capabilities (struct packet_reader * reader , int * linelen )
234
+ static void process_capabilities (struct packet_reader * reader , size_t * linelen )
236
235
{
237
236
const char * feat_val ;
238
237
size_t feat_len ;
239
238
const char * line = reader -> line ;
240
- int nul_location = strlen (line );
239
+ size_t nul_location = strlen (line );
241
240
if (nul_location == * linelen )
242
241
return ;
243
242
server_capabilities_v1 = xstrdup (line + nul_location + 1 );
@@ -271,14 +270,14 @@ static int process_dummy_ref(const struct packet_reader *reader)
271
270
!strcmp (name , "capabilities^{}" );
272
271
}
273
272
274
- static void check_no_capabilities (const char * line , int len )
273
+ static void check_no_capabilities (const char * line , size_t len )
275
274
{
276
275
if (strlen (line ) != len )
277
276
warning (_ ("ignoring capabilities after first line '%s'" ),
278
277
line + strlen (line ));
279
278
}
280
279
281
- static int process_ref (const struct packet_reader * reader , int len ,
280
+ static int process_ref (const struct packet_reader * reader , size_t len ,
282
281
struct ref * * * list , unsigned int flags ,
283
282
struct oid_array * extra_have )
284
283
{
@@ -306,7 +305,7 @@ static int process_ref(const struct packet_reader *reader, int len,
306
305
return 1 ;
307
306
}
308
307
309
- static int process_shallow (const struct packet_reader * reader , int len ,
308
+ static int process_shallow (const struct packet_reader * reader , size_t len ,
310
309
struct oid_array * shallow_points )
311
310
{
312
311
const char * line = reader -> line ;
@@ -341,7 +340,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,
341
340
struct oid_array * shallow_points )
342
341
{
343
342
struct ref * * orig_list = list ;
344
- int len = 0 ;
343
+ size_t len = 0 ;
345
344
enum get_remote_heads_state state = EXPECTING_FIRST_REF ;
346
345
347
346
* list = NULL ;
@@ -394,7 +393,7 @@ static int process_ref_v2(struct packet_reader *reader, struct ref ***list,
394
393
const char * * unborn_head_target )
395
394
{
396
395
int ret = 1 ;
397
- int i = 0 ;
396
+ size_t i = 0 ;
398
397
struct object_id old_oid ;
399
398
struct ref * ref ;
400
399
struct string_list line_sections = STRING_LIST_INIT_DUP ;
@@ -552,7 +551,7 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
552
551
const struct string_list * server_options ,
553
552
int stateless_rpc )
554
553
{
555
- int i ;
554
+ size_t i ;
556
555
struct strvec * ref_prefixes = transport_options ?
557
556
& transport_options -> ref_prefixes : NULL ;
558
557
const char * * unborn_head_target = transport_options ?
0 commit comments