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:
authorJeff King <peff@peff.net>2020-02-24 07:36:56 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-24 23:55:53 +0300
commitb99b6bcc57faf5c989fc18c3b8d4d92df3407cec (patch)
tree1cc189885d98924650c5610c8e846e9b23ab45bc /ref-filter.c
parent63f4a7fc0107ec240f48605a4d4f8e41b91caa41 (diff)
packed_object_info(): use object_id for returning delta base
If a caller sets the object_info.delta_base_sha1 to a non-NULL pointer, we'll write the oid of the object's delta base to it. But we can increase our type safety by switching this to a real object_id struct. All of our callers are just pointing into the hash member of an object_id anyway, so there's no inconvenience. Note that we do still keep it as a pointer-to-struct, because the NULL sentinel value tells us whether the caller is even interested in the information. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 6867e33648..79bb520678 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -279,9 +279,9 @@ static int deltabase_atom_parser(const struct ref_format *format, struct used_at
if (arg)
return strbuf_addf_ret(err, -1, _("%%(deltabase) does not take arguments"));
if (*atom->name == '*')
- oi_deref.info.delta_base_sha1 = oi_deref.delta_base_oid.hash;
+ oi_deref.info.delta_base_oid = &oi_deref.delta_base_oid;
else
- oi.info.delta_base_sha1 = oi.delta_base_oid.hash;
+ oi.info.delta_base_oid = &oi.delta_base_oid;
return 0;
}