Skip to content

Commit f3f9724

Browse files
mhaggergitster
authored andcommitted
get_packed_ref(): take a packed_ref_store * parameter
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 38e3fe6 commit f3f9724

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

refs/files-backend.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,10 @@ static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs)
602602
* Return the ref_entry for the given refname from the packed
603603
* references. If it does not exist, return NULL.
604604
*/
605-
static struct ref_entry *get_packed_ref(struct files_ref_store *refs,
605+
static struct ref_entry *get_packed_ref(struct packed_ref_store *refs,
606606
const char *refname)
607607
{
608-
return find_ref_entry(get_packed_refs(refs->packed_ref_store), refname);
608+
return find_ref_entry(get_packed_refs(refs), refname);
609609
}
610610

611611
/*
@@ -621,7 +621,7 @@ static int resolve_packed_ref(struct files_ref_store *refs,
621621
* The loose reference file does not exist; check for a packed
622622
* reference.
623623
*/
624-
entry = get_packed_ref(refs, refname);
624+
entry = get_packed_ref(refs->packed_ref_store, refname);
625625
if (entry) {
626626
hashcpy(sha1, entry->u.value.oid.hash);
627627
*flags |= REF_ISPACKED;
@@ -1044,7 +1044,9 @@ static int files_peel_ref(struct ref_store *ref_store,
10441044
* have REF_KNOWS_PEELED.
10451045
*/
10461046
if (flag & REF_ISPACKED) {
1047-
struct ref_entry *r = get_packed_ref(refs, refname);
1047+
struct ref_entry *r =
1048+
get_packed_ref(refs->packed_ref_store, refname);
1049+
10481050
if (r) {
10491051
if (peel_entry(r, 0))
10501052
return -1;
@@ -1631,7 +1633,7 @@ static int repack_without_refs(struct files_ref_store *refs,
16311633

16321634
/* Look for a packed ref */
16331635
for_each_string_list_item(refname, refnames) {
1634-
if (get_packed_ref(refs, refname->string)) {
1636+
if (get_packed_ref(refs->packed_ref_store, refname->string)) {
16351637
needs_repacking = 1;
16361638
break;
16371639
}

0 commit comments

Comments
 (0)