diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-06-23 09:01:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-23 13:27:32 -0700 |
commit | e70b70294e7010c6281766b5229fb811df193870 (patch) | |
tree | c59ca695b85ae803cdd0850b8ca456825c042227 /refs | |
parent | get_packed_refs(): take a `packed_ref_store *` parameter (diff) | |
download | tgif-e70b70294e7010c6281766b5229fb811df193870.tar.xz |
add_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>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index bc5c0de84e..4943207098 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -438,19 +438,19 @@ static struct ref_dir *get_packed_refs(struct packed_ref_store *refs) * (see lock_packed_refs()). To actually write the packed-refs file, * call commit_packed_refs(). */ -static void add_packed_ref(struct files_ref_store *refs, +static void add_packed_ref(struct packed_ref_store *refs, const char *refname, const struct object_id *oid) { struct ref_dir *packed_refs; struct ref_entry *packed_entry; - if (!is_lock_file_locked(&refs->packed_ref_store->lock)) + if (!is_lock_file_locked(&refs->lock)) die("BUG: packed refs not locked"); if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) die("Reference has invalid format: '%s'", refname); - packed_refs = get_packed_refs(refs->packed_ref_store); + packed_refs = get_packed_refs(refs); packed_entry = find_ref_entry(packed_refs, refname); if (packed_entry) { /* Overwrite the existing entry: */ @@ -1579,7 +1579,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags) * we don't copy the peeled status, because we want it * to be re-peeled. */ - add_packed_ref(refs, iter->refname, iter->oid); + add_packed_ref(refs->packed_ref_store, iter->refname, iter->oid); /* Schedule the loose reference for pruning if requested. */ if ((flags & PACK_REFS_PRUNE)) { @@ -3210,7 +3210,7 @@ static int files_initial_transaction_commit(struct ref_store *ref_store, if ((update->flags & REF_HAVE_NEW) && !is_null_oid(&update->new_oid)) - add_packed_ref(refs, update->refname, + add_packed_ref(refs->packed_ref_store, update->refname, &update->new_oid); } |