@@ -127,7 +127,9 @@ static int list_refs(struct ref_list *r, int argc, const char **argv)
127
127
/* Remember to update object flag allocation in object.h */
128
128
#define PREREQ_MARK (1u<<16)
129
129
130
- int verify_bundle (struct bundle_header * header , int verbose )
130
+ int verify_bundle (struct repository * r ,
131
+ struct bundle_header * header ,
132
+ int verbose )
131
133
{
132
134
/*
133
135
* Do fast check, then if any prereqs are missing then go line by line
@@ -140,10 +142,10 @@ int verify_bundle(struct bundle_header *header, int verbose)
140
142
int i , ret = 0 , req_nr ;
141
143
const char * message = _ ("Repository lacks these prerequisite commits:" );
142
144
143
- repo_init_revisions (the_repository , & revs , NULL );
145
+ repo_init_revisions (r , & revs , NULL );
144
146
for (i = 0 ; i < p -> nr ; i ++ ) {
145
147
struct ref_list_entry * e = p -> list + i ;
146
- struct object * o = parse_object (the_repository , & e -> oid );
148
+ struct object * o = parse_object (r , & e -> oid );
147
149
if (o ) {
148
150
o -> flags |= PREREQ_MARK ;
149
151
add_pending_object (& revs , o , e -> name );
@@ -168,7 +170,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
168
170
169
171
for (i = 0 ; i < p -> nr ; i ++ ) {
170
172
struct ref_list_entry * e = p -> list + i ;
171
- struct object * o = parse_object (the_repository , & e -> oid );
173
+ struct object * o = parse_object (r , & e -> oid );
172
174
assert (o ); /* otherwise we'd have returned early */
173
175
if (o -> flags & SHOWN )
174
176
continue ;
@@ -180,7 +182,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
180
182
/* Clean up objects used, as they will be reused. */
181
183
for (i = 0 ; i < p -> nr ; i ++ ) {
182
184
struct ref_list_entry * e = p -> list + i ;
183
- commit = lookup_commit_reference_gently (the_repository , & e -> oid , 1 );
185
+ commit = lookup_commit_reference_gently (r , & e -> oid , 1 );
184
186
if (commit )
185
187
clear_commit_marks (commit , ALL_REV_FLAGS );
186
188
}
@@ -375,8 +377,7 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
375
377
* in terms of a tag (e.g. v2.0 from the range
376
378
* "v1.0..v2.0")?
377
379
*/
378
- struct commit * one = lookup_commit_reference (the_repository ,
379
- & oid );
380
+ struct commit * one = lookup_commit_reference (revs -> repo , & oid );
380
381
struct object * obj ;
381
382
382
383
if (e -> item == & (one -> object )) {
@@ -409,8 +410,8 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
409
410
return ref_count ;
410
411
}
411
412
412
- int create_bundle (struct bundle_header * header , const char * path ,
413
- int argc , const char * * argv )
413
+ int create_bundle (struct repository * r , struct bundle_header * header ,
414
+ const char * path , int argc , const char * * argv )
414
415
{
415
416
struct lock_file lock = LOCK_INIT ;
416
417
int bundle_fd = -1 ;
@@ -441,7 +442,7 @@ int create_bundle(struct bundle_header *header, const char *path,
441
442
442
443
/* init revs to list objects for pack-objects later */
443
444
save_commit_buffer = 0 ;
444
- repo_init_revisions (the_repository , & revs , NULL );
445
+ repo_init_revisions (r , & revs , NULL );
445
446
446
447
/* write prerequisites */
447
448
if (compute_and_write_prerequisites (bundle_fd , & revs , argc , argv ))
@@ -482,7 +483,8 @@ int create_bundle(struct bundle_header *header, const char *path,
482
483
return -1 ;
483
484
}
484
485
485
- int unbundle (struct bundle_header * header , int bundle_fd , int flags )
486
+ int unbundle (struct repository * r , struct bundle_header * header ,
487
+ int bundle_fd , int flags )
486
488
{
487
489
const char * argv_index_pack [] = {"index-pack" ,
488
490
"--fix-thin" , "--stdin" , NULL , NULL };
@@ -491,7 +493,7 @@ int unbundle(struct bundle_header *header, int bundle_fd, int flags)
491
493
if (flags & BUNDLE_VERBOSE )
492
494
argv_index_pack [3 ] = "-v" ;
493
495
494
- if (verify_bundle (header , 0 ))
496
+ if (verify_bundle (r , header , 0 ))
495
497
return -1 ;
496
498
ip .argv = argv_index_pack ;
497
499
ip .in = bundle_fd ;
0 commit comments