@@ -1104,9 +1104,9 @@ static const unsigned char *get_delta_base_sha1(struct packed_git *p,
1104
1104
return NULL ;
1105
1105
}
1106
1106
1107
- #define retry_bad_packed_offset (r , p , o ) \
1108
- retry_bad_packed_offset_##r(p, o)
1109
- static int retry_bad_packed_offset_the_repository ( struct packed_git * p , off_t obj_offset )
1107
+ static int retry_bad_packed_offset (struct repository * r ,
1108
+ struct packed_git * p ,
1109
+ off_t obj_offset )
1110
1110
{
1111
1111
int type ;
1112
1112
struct revindex_entry * revidx ;
@@ -1116,21 +1116,20 @@ static int retry_bad_packed_offset_the_repository(struct packed_git *p, off_t ob
1116
1116
return OBJ_BAD ;
1117
1117
nth_packed_object_oid (& oid , p , revidx -> nr );
1118
1118
mark_bad_packed_object (p , oid .hash );
1119
- type = oid_object_info (the_repository , & oid , NULL );
1119
+ type = oid_object_info (r , & oid , NULL );
1120
1120
if (type <= OBJ_NONE )
1121
1121
return OBJ_BAD ;
1122
1122
return type ;
1123
1123
}
1124
1124
1125
1125
#define POI_STACK_PREALLOC 64
1126
1126
1127
- #define packed_to_object_type (r , p , o , t , w , c ) \
1128
- packed_to_object_type_##r(p, o, t, w, c)
1129
- static enum object_type packed_to_object_type_the_repository (struct packed_git * p ,
1130
- off_t obj_offset ,
1131
- enum object_type type ,
1132
- struct pack_window * * w_curs ,
1133
- off_t curpos )
1127
+ static enum object_type packed_to_object_type (struct repository * r ,
1128
+ struct packed_git * p ,
1129
+ off_t obj_offset ,
1130
+ enum object_type type ,
1131
+ struct pack_window * * w_curs ,
1132
+ off_t curpos )
1134
1133
{
1135
1134
off_t small_poi_stack [POI_STACK_PREALLOC ];
1136
1135
off_t * poi_stack = small_poi_stack ;
@@ -1157,7 +1156,7 @@ static enum object_type packed_to_object_type_the_repository(struct packed_git *
1157
1156
if (type <= OBJ_NONE ) {
1158
1157
/* If getting the base itself fails, we first
1159
1158
* retry the base, otherwise unwind */
1160
- type = retry_bad_packed_offset (the_repository , p , base_offset );
1159
+ type = retry_bad_packed_offset (r , p , base_offset );
1161
1160
if (type > OBJ_NONE )
1162
1161
goto out ;
1163
1162
goto unwind ;
@@ -1185,7 +1184,7 @@ static enum object_type packed_to_object_type_the_repository(struct packed_git *
1185
1184
unwind :
1186
1185
while (poi_stack_nr ) {
1187
1186
obj_offset = poi_stack [-- poi_stack_nr ];
1188
- type = retry_bad_packed_offset (the_repository , p , obj_offset );
1187
+ type = retry_bad_packed_offset (r , p , obj_offset );
1189
1188
if (type > OBJ_NONE )
1190
1189
goto out ;
1191
1190
}
@@ -1272,15 +1271,15 @@ static void detach_delta_base_cache_entry(struct delta_base_cache_entry *ent)
1272
1271
free (ent );
1273
1272
}
1274
1273
1275
- #define cache_or_unpack_entry (r , p , bo , bs , t ) cache_or_unpack_entry_##r(p, bo, bs, t)
1276
- static void * cache_or_unpack_entry_the_repository ( struct packed_git * p , off_t base_offset ,
1277
- unsigned long * base_size , enum object_type * type )
1274
+ static void * cache_or_unpack_entry (struct repository * r , struct packed_git * p ,
1275
+ off_t base_offset , unsigned long * base_size ,
1276
+ enum object_type * type )
1278
1277
{
1279
1278
struct delta_base_cache_entry * ent ;
1280
1279
1281
1280
ent = get_delta_base_cache_entry (p , base_offset );
1282
1281
if (!ent )
1283
- return unpack_entry (the_repository , p , base_offset , type , base_size );
1282
+ return unpack_entry (r , p , base_offset , type , base_size );
1284
1283
1285
1284
if (type )
1286
1285
* type = ent -> type ;
@@ -1334,8 +1333,8 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
1334
1333
hashmap_add (& delta_base_cache , ent );
1335
1334
}
1336
1335
1337
- int packed_object_info_the_repository (struct packed_git * p , off_t obj_offset ,
1338
- struct object_info * oi )
1336
+ int packed_object_info (struct repository * r , struct packed_git * p ,
1337
+ off_t obj_offset , struct object_info * oi )
1339
1338
{
1340
1339
struct pack_window * w_curs = NULL ;
1341
1340
unsigned long size ;
@@ -1347,7 +1346,7 @@ int packed_object_info_the_repository(struct packed_git *p, off_t obj_offset,
1347
1346
* a "real" type later if the caller is interested.
1348
1347
*/
1349
1348
if (oi -> contentp ) {
1350
- * oi -> contentp = cache_or_unpack_entry (the_repository , p , obj_offset , oi -> sizep ,
1349
+ * oi -> contentp = cache_or_unpack_entry (r , p , obj_offset , oi -> sizep ,
1351
1350
& type );
1352
1351
if (!* oi -> contentp )
1353
1352
type = OBJ_BAD ;
@@ -1381,7 +1380,7 @@ int packed_object_info_the_repository(struct packed_git *p, off_t obj_offset,
1381
1380
1382
1381
if (oi -> typep || oi -> type_name ) {
1383
1382
enum object_type ptot ;
1384
- ptot = packed_to_object_type (the_repository , p , obj_offset ,
1383
+ ptot = packed_to_object_type (r , p , obj_offset ,
1385
1384
type , & w_curs , curpos );
1386
1385
if (oi -> typep )
1387
1386
* oi -> typep = ptot ;
@@ -1470,25 +1469,24 @@ struct unpack_entry_stack_ent {
1470
1469
unsigned long size ;
1471
1470
};
1472
1471
1473
- #define read_object (r , o , t , s ) read_object_##r(o, t, s)
1474
- static void * read_object_the_repository ( const struct object_id * oid ,
1475
- enum object_type * type ,
1476
- unsigned long * size )
1472
+ static void * read_object (struct repository * r ,
1473
+ const struct object_id * oid ,
1474
+ enum object_type * type ,
1475
+ unsigned long * size )
1477
1476
{
1478
1477
struct object_info oi = OBJECT_INFO_INIT ;
1479
1478
void * content ;
1480
1479
oi .typep = type ;
1481
1480
oi .sizep = size ;
1482
1481
oi .contentp = & content ;
1483
1482
1484
- if (oid_object_info_extended (the_repository , oid , & oi , 0 ) < 0 )
1483
+ if (oid_object_info_extended (r , oid , & oi , 0 ) < 0 )
1485
1484
return NULL ;
1486
1485
return content ;
1487
1486
}
1488
1487
1489
- void * unpack_entry_the_repository (struct packed_git * p , off_t obj_offset ,
1490
- enum object_type * final_type ,
1491
- unsigned long * final_size )
1488
+ void * unpack_entry (struct repository * r , struct packed_git * p , off_t obj_offset ,
1489
+ enum object_type * final_type , unsigned long * final_size )
1492
1490
{
1493
1491
struct pack_window * w_curs = NULL ;
1494
1492
off_t curpos = obj_offset ;
@@ -1618,7 +1616,7 @@ void *unpack_entry_the_repository(struct packed_git *p, off_t obj_offset,
1618
1616
oid_to_hex (& base_oid ), (uintmax_t )obj_offset ,
1619
1617
p -> pack_name );
1620
1618
mark_bad_packed_object (p , base_oid .hash );
1621
- base = read_object (the_repository , & base_oid , & type , & base_size );
1619
+ base = read_object (r , & base_oid , & type , & base_size );
1622
1620
external_base = base ;
1623
1621
}
1624
1622
}
0 commit comments