refs: remove `delete_refs` callback from backends
Now that `refs_delete_refs` is implemented in a generic way via the ref transaction interfaces there are no callers left that invoke the `delete_refs` callback anymore. Remove it from all of our backends. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Nov 14, 2023 at 09:58 UTC
29a186917b58bf67e14667a7a7641f5dddcc8589
4 files changed
-32
refs/debug.c
-15
@@ -143,20 +143,6 @@ static int debug_create_symref(struct ref_store *ref_store,
143
return res;
144
}
145
146
-static int debug_delete_refs(struct ref_store *ref_store, const char *msg,
147
- struct string_list *refnames, unsigned int flags)
148
-{
149
- struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
150
- int res =
151
- drefs->refs->be->delete_refs(drefs->refs, msg, refnames, flags);
152
- int i;
153
- trace_printf_key(&trace_refs, "delete_refs {\n");
154
- for (i = 0; i < refnames->nr; i++)
155
- trace_printf_key(&trace_refs, "%s\n", refnames->items[i].string);
156
- trace_printf_key(&trace_refs, "}: %d\n", res);
157
- return res;
158
-}
159
-
146
static int debug_rename_ref(struct ref_store *ref_store, const char *oldref,
147
const char *newref, const char *logmsg)
148
{
@@ -458,7 +444,6 @@ struct ref_storage_be refs_be_debug = {
444
445
.pack_refs = debug_pack_refs,
446
.create_symref = debug_create_symref,
461
- .delete_refs = debug_delete_refs,
447
.rename_ref = debug_rename_ref,
448
.copy_ref = debug_copy_ref,
449
refs/files-backend.c
-7
@@ -1265,12 +1265,6 @@ static int files_pack_refs(struct ref_store *ref_store,
1265
return 0;
1266
}
1267
1268
-static int files_delete_refs(struct ref_store *ref_store, const char *msg,
1269
- struct string_list *refnames, unsigned int flags)
1270
-{
1271
- return refs_delete_refs(ref_store, msg, refnames, flags);
1272
-}
1273
-
1268
/*
1269
* People using contrib's git-new-workdir have .git/logs/refs ->
1270
* /some/other/path/.git/logs/refs, and that may live on another device.
@@ -3258,7 +3252,6 @@ struct ref_storage_be refs_be_files = {
3252
3253
.pack_refs = files_pack_refs,
3254
.create_symref = files_create_symref,
3261
- .delete_refs = files_delete_refs,
3255
.rename_ref = files_rename_ref,
3256
.copy_ref = files_copy_ref,
3257
refs/packed-backend.c
-7
@@ -1688,12 +1688,6 @@ static int packed_initial_transaction_commit(struct ref_store *ref_store UNUSED,
1688
return ref_transaction_commit(transaction, err);
1689
}
1690
1691
-static int packed_delete_refs(struct ref_store *ref_store, const char *msg,
1692
- struct string_list *refnames, unsigned int flags)
1693
-{
1694
- return refs_delete_refs(ref_store, msg, refnames, flags);
1695
-}
1696
-
1691
static int packed_pack_refs(struct ref_store *ref_store UNUSED,
1692
struct pack_refs_opts *pack_opts UNUSED)
1693
{
@@ -1722,7 +1716,6 @@ struct ref_storage_be refs_be_packed = {
1716
1717
.pack_refs = packed_pack_refs,
1718
.create_symref = NULL,
1725
- .delete_refs = packed_delete_refs,
1719
.rename_ref = NULL,
1720
.copy_ref = NULL,
1721
refs/refs-internal.h
-3
@@ -553,8 +553,6 @@ typedef int create_symref_fn(struct ref_store *ref_store,
553
const char *ref_target,
554
const char *refs_heads_master,
555
const char *logmsg);
556
-typedef int delete_refs_fn(struct ref_store *ref_store, const char *msg,
557
- struct string_list *refnames, unsigned int flags);
556
typedef int rename_ref_fn(struct ref_store *ref_store,
557
const char *oldref, const char *newref,
558
const char *logmsg);
@@ -677,7 +675,6 @@ struct ref_storage_be {
675
676
pack_refs_fn *pack_refs;
677
create_symref_fn *create_symref;
680
- delete_refs_fn *delete_refs;
678
rename_ref_fn *rename_ref;
679
copy_ref_fn *copy_ref;
680