Skip to content

Commit 29a1869

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d6f8e72 commit 29a1869

File tree

4 files changed

+0
-32
lines changed

4 files changed

+0
-32
lines changed

refs/debug.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,6 @@ static int debug_create_symref(struct ref_store *ref_store,
143143
return res;
144144
}
145145

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-
160146
static int debug_rename_ref(struct ref_store *ref_store, const char *oldref,
161147
const char *newref, const char *logmsg)
162148
{
@@ -458,7 +444,6 @@ struct ref_storage_be refs_be_debug = {
458444

459445
.pack_refs = debug_pack_refs,
460446
.create_symref = debug_create_symref,
461-
.delete_refs = debug_delete_refs,
462447
.rename_ref = debug_rename_ref,
463448
.copy_ref = debug_copy_ref,
464449

refs/files-backend.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,12 +1265,6 @@ static int files_pack_refs(struct ref_store *ref_store,
12651265
return 0;
12661266
}
12671267

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-
12741268
/*
12751269
* People using contrib's git-new-workdir have .git/logs/refs ->
12761270
* /some/other/path/.git/logs/refs, and that may live on another device.
@@ -3258,7 +3252,6 @@ struct ref_storage_be refs_be_files = {
32583252

32593253
.pack_refs = files_pack_refs,
32603254
.create_symref = files_create_symref,
3261-
.delete_refs = files_delete_refs,
32623255
.rename_ref = files_rename_ref,
32633256
.copy_ref = files_copy_ref,
32643257

refs/packed-backend.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,12 +1688,6 @@ static int packed_initial_transaction_commit(struct ref_store *ref_store UNUSED,
16881688
return ref_transaction_commit(transaction, err);
16891689
}
16901690

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-
16971691
static int packed_pack_refs(struct ref_store *ref_store UNUSED,
16981692
struct pack_refs_opts *pack_opts UNUSED)
16991693
{
@@ -1722,7 +1716,6 @@ struct ref_storage_be refs_be_packed = {
17221716

17231717
.pack_refs = packed_pack_refs,
17241718
.create_symref = NULL,
1725-
.delete_refs = packed_delete_refs,
17261719
.rename_ref = NULL,
17271720
.copy_ref = NULL,
17281721

refs/refs-internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,6 @@ typedef int create_symref_fn(struct ref_store *ref_store,
553553
const char *ref_target,
554554
const char *refs_heads_master,
555555
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);
558556
typedef int rename_ref_fn(struct ref_store *ref_store,
559557
const char *oldref, const char *newref,
560558
const char *logmsg);
@@ -677,7 +675,6 @@ struct ref_storage_be {
677675

678676
pack_refs_fn *pack_refs;
679677
create_symref_fn *create_symref;
680-
delete_refs_fn *delete_refs;
681678
rename_ref_fn *rename_ref;
682679
copy_ref_fn *copy_ref;
683680

0 commit comments

Comments
 (0)