Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-07-02 12:57:31 +0300
committerJunio C Hamano <gitster@pobox.com>2021-07-06 22:10:16 +0300
commit15e7c7dca66ab7b020316696f54433f76e5e1084 (patch)
tree95af454c2ca53d06ec3056dc82dc8f58c850c273 /transport.c
parentdb6bfb9fe8098b8795d8e6bb8c6d85fd39f2cdaf (diff)
bundle.c: use a temporary variable for OIDs and names
In preparation for moving away from accessing the OID and name via the "oid" and "name" slots in a subsequent commit, change the code that accesses it to use named variables. This makes the subsequent change smaller. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index 50f5830eb6..95c1138e9a 100644
--- a/transport.c
+++ b/transport.c
@@ -148,8 +148,10 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
for (i = 0; i < data->header.references.nr; i++) {
struct ref_list_entry *e = data->header.references.list + i;
- struct ref *ref = alloc_ref(e->name);
- oidcpy(&ref->old_oid, &e->oid);
+ const char *name = e->name;
+ struct ref *ref = alloc_ref(name);
+ struct object_id *oid = &e->oid;
+ oidcpy(&ref->old_oid, oid);
ref->next = result;
result = ref;
}