summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2016-09-04 18:08:27 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-09 15:28:13 -0700
commit8231527e1510127a5611a2e2f9660e6aef1c981e (patch)
tree89fff9022bab94959c0b09ae7597f4a6e3241df4 /refs
parentrefs: make verify_refname_available() virtual (diff)
downloadtgif-8231527e1510127a5611a2e2f9660e6aef1c981e.tar.xz
refs: make pack_refs() virtual
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.c6
-rw-r--r--refs/refs-internal.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 44eef1cec7..5ba2804a86 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2354,10 +2354,10 @@ static void prune_refs(struct ref_to_prune *r)
}
}
-int pack_refs(unsigned int flags)
+static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
{
struct files_ref_store *refs =
- get_files_ref_store(NULL, "pack_refs");
+ files_downcast(ref_store, 0, "pack_refs");
struct pack_refs_cb_data cbdata;
memset(&cbdata, 0, sizeof(cbdata));
@@ -4022,6 +4022,8 @@ struct ref_storage_be refs_be_files = {
files_ref_store_create,
files_transaction_commit,
+ files_pack_refs,
+
files_read_raw_ref,
files_verify_refname_available
};
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 6c698f442d..256f7f581f 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -500,6 +500,8 @@ typedef int ref_transaction_commit_fn(struct ref_store *refs,
struct ref_transaction *transaction,
struct strbuf *err);
+typedef int pack_refs_fn(struct ref_store *ref_store, unsigned int flags);
+
/*
* Read a reference from the specified reference store, non-recursively.
* Set type to describe the reference, and:
@@ -554,6 +556,8 @@ struct ref_storage_be {
ref_store_init_fn *init;
ref_transaction_commit_fn *transaction_commit;
+ pack_refs_fn *pack_refs;
+
read_raw_ref_fn *read_raw_ref;
verify_refname_available_fn *verify_refname_available;
};