refs: make delete_refs() virtual
In the file-based backend, delete_refs has some special optimization
to deal with packed refs. In other backends, we might be able to make
ref deletion faster by putting all deletions into a single
transaction. So we need a special backend function for this.
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 08c8586..ade6501 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -490,6 +490,8 @@
const char *ref_target,
const char *refs_heads_master,
const char *logmsg);
+typedef int delete_refs_fn(struct ref_store *ref_store,
+ struct string_list *refnames, unsigned int flags);
/*
* Iterate over the references in the specified ref_store that are
@@ -587,6 +589,7 @@
pack_refs_fn *pack_refs;
peel_ref_fn *peel_ref;
create_symref_fn *create_symref;
+ delete_refs_fn *delete_refs;
ref_iterator_begin_fn *iterator_begin;
read_raw_ref_fn *read_raw_ref;