transport: rename "fetch" in transport_vtable to "fetch_refs"
Rename the "fetch" member of the transport_vtable to "fetch_refs" for consistency with the existing "push_refs". Neither of them just push "refs" but refs and objects, but having the two match makes the code more readable than having it be inconsistent, especially since "fetch_refs" is a lot easier to grep for than "fetch". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Aug 5, 2021 at 03:25 UTC
9b1cdd334d458a063dd43058fca551b7ab57e333
3 files changed
+6
-6
transport-helper.c
+4
-4
@@ -671,8 +671,8 @@ static int connect_helper(struct transport *transport, const char *name,
671
static struct ref *get_refs_list_using_list(struct transport *transport,
672
int for_push);
673
674
-static int fetch(struct transport *transport,
675
- int nr_heads, struct ref **to_fetch)
674
+static int fetch_refs(struct transport *transport,
675
+ int nr_heads, struct ref **to_fetch)
676
{
677
struct helper_data *data = transport->data;
678
int i, count;
@@ -681,7 +681,7 @@ static int fetch(struct transport *transport,
681
682
if (process_connect(transport, 0)) {
683
do_take_over(transport);
684
- return transport->vtable->fetch(transport, nr_heads, to_fetch);
684
+ return transport->vtable->fetch_refs(transport, nr_heads, to_fetch);
685
}
686
687
/*
@@ -1263,7 +1263,7 @@ static struct ref *get_refs_list_using_list(struct transport *transport,
1263
static struct transport_vtable vtable = {
1264
set_helper_option,
1265
get_refs_list,
1266
- fetch,
1266
+ fetch_refs,
1267
push_refs,
1268
connect_helper,
1269
release_helper
transport-internal.h
+1
-1
@@ -34,7 +34,7 @@ struct transport_vtable {
34
* get_refs_list(), it should set the old_sha1 fields in the
35
* provided refs now.
36
**/
37
- int (*fetch)(struct transport *transport, int refs_nr, struct ref **refs);
37
+ int (*fetch_refs)(struct transport *transport, int refs_nr, struct ref **refs);
38
39
/**
40
* Push the objects and refs. Send the necessary objects, and
transport.c
+1
-1
@@ -1453,7 +1453,7 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs)
1453
heads[nr_heads++] = rm;
1454
}
1455
1456
- rc = transport->vtable->fetch(transport, nr_heads, heads);
1456
+ rc = transport->vtable->fetch_refs(transport, nr_heads, heads);
1457
1458
free(heads);
1459
return rc;