@@ -1237,7 +1237,8 @@ static void prune_refs(struct files_ref_store *refs, struct ref_to_prune **refs_
1237
1237
/*
1238
1238
* Return true if the specified reference should be packed.
1239
1239
*/
1240
- static int should_pack_ref (const char * refname ,
1240
+ static int should_pack_ref (struct files_ref_store * refs ,
1241
+ const char * refname ,
1241
1242
const struct object_id * oid , unsigned int ref_flags ,
1242
1243
struct pack_refs_opts * opts )
1243
1244
{
@@ -1253,7 +1254,7 @@ static int should_pack_ref(const char *refname,
1253
1254
return 0 ;
1254
1255
1255
1256
/* Do not pack broken refs: */
1256
- if (!ref_resolves_to_object (refname , the_repository , oid , ref_flags ))
1257
+ if (!ref_resolves_to_object (refname , refs -> base . repo , oid , ref_flags ))
1257
1258
return 0 ;
1258
1259
1259
1260
if (ref_excluded (opts -> exclusions , refname ))
@@ -1285,14 +1286,14 @@ static int files_pack_refs(struct ref_store *ref_store,
1285
1286
packed_refs_lock (refs -> packed_ref_store , LOCK_DIE_ON_ERROR , & err );
1286
1287
1287
1288
iter = cache_ref_iterator_begin (get_loose_ref_cache (refs , 0 ), NULL ,
1288
- the_repository , 0 );
1289
+ refs -> base . repo , 0 );
1289
1290
while ((ok = ref_iterator_advance (iter )) == ITER_OK ) {
1290
1291
/*
1291
1292
* If the loose reference can be packed, add an entry
1292
1293
* in the packed ref cache. If the reference should be
1293
1294
* pruned, also add it to refs_to_prune.
1294
1295
*/
1295
- if (!should_pack_ref (iter -> refname , iter -> oid , iter -> flags , opts ))
1296
+ if (!should_pack_ref (refs , iter -> refname , iter -> oid , iter -> flags , opts ))
1296
1297
continue ;
1297
1298
1298
1299
/*
@@ -1389,7 +1390,8 @@ static int rename_tmp_log(struct files_ref_store *refs, const char *newrefname)
1389
1390
return ret ;
1390
1391
}
1391
1392
1392
- static int write_ref_to_lockfile (struct ref_lock * lock ,
1393
+ static int write_ref_to_lockfile (struct files_ref_store * refs ,
1394
+ struct ref_lock * lock ,
1393
1395
const struct object_id * oid ,
1394
1396
int skip_oid_verification , struct strbuf * err );
1395
1397
static int commit_ref_update (struct files_ref_store * refs ,
@@ -1537,7 +1539,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1537
1539
}
1538
1540
oidcpy (& lock -> old_oid , & orig_oid );
1539
1541
1540
- if (write_ref_to_lockfile (lock , & orig_oid , 0 , & err ) ||
1542
+ if (write_ref_to_lockfile (refs , lock , & orig_oid , 0 , & err ) ||
1541
1543
commit_ref_update (refs , lock , & orig_oid , logmsg , & err )) {
1542
1544
error ("unable to write current sha1 into %s: %s" , newrefname , err .buf );
1543
1545
strbuf_release (& err );
@@ -1557,7 +1559,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1557
1559
1558
1560
flag = log_all_ref_updates ;
1559
1561
log_all_ref_updates = LOG_REFS_NONE ;
1560
- if (write_ref_to_lockfile (lock , & orig_oid , 0 , & err ) ||
1562
+ if (write_ref_to_lockfile (refs , lock , & orig_oid , 0 , & err ) ||
1561
1563
commit_ref_update (refs , lock , & orig_oid , NULL , & err )) {
1562
1564
error ("unable to write current sha1 into %s: %s" , oldrefname , err .buf );
1563
1565
strbuf_release (& err );
@@ -1791,7 +1793,8 @@ static int files_log_ref_write(struct files_ref_store *refs,
1791
1793
* Write oid into the open lockfile, then close the lockfile. On
1792
1794
* errors, rollback the lockfile, fill in *err and return -1.
1793
1795
*/
1794
- static int write_ref_to_lockfile (struct ref_lock * lock ,
1796
+ static int write_ref_to_lockfile (struct files_ref_store * refs ,
1797
+ struct ref_lock * lock ,
1795
1798
const struct object_id * oid ,
1796
1799
int skip_oid_verification , struct strbuf * err )
1797
1800
{
@@ -1800,7 +1803,7 @@ static int write_ref_to_lockfile(struct ref_lock *lock,
1800
1803
int fd ;
1801
1804
1802
1805
if (!skip_oid_verification ) {
1803
- o = parse_object (the_repository , oid );
1806
+ o = parse_object (refs -> base . repo , oid );
1804
1807
if (!o ) {
1805
1808
strbuf_addf (
1806
1809
err ,
@@ -2571,7 +2574,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
2571
2574
* value, so we don't need to write it.
2572
2575
*/
2573
2576
} else if (write_ref_to_lockfile (
2574
- lock , & update -> new_oid ,
2577
+ refs , lock , & update -> new_oid ,
2575
2578
update -> flags & REF_SKIP_OID_VERIFICATION ,
2576
2579
err )) {
2577
2580
char * write_err = strbuf_detach (err , NULL );
0 commit comments