summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-09-05 22:52:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-09-06 18:03:39 (GMT)
commitf1cbd033e201a18c7175bc6509b48d6243e79739 (patch)
tree570056d516b231b921e53f5292e0f61dc001cc66 /builtin/pack-objects.c
parent0dfed92dfdb95c2f12df7299bb1e606d79185626 (diff)
downloadgit-f1cbd033e201a18c7175bc6509b48d6243e79739.zip
git-f1cbd033e201a18c7175bc6509b48d6243e79739.tar.gz
git-f1cbd033e201a18c7175bc6509b48d6243e79739.tar.bz2
pack-objects: use object_id in packlist_alloc()
The only caller of packlist_alloc() already has a "struct object_id", and we immediately copy the hash they pass us into our own object_id. Let's avoid the unnecessary round-trip to a raw sha1 pointer. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 76ce906..dc2a7e9 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1147,7 +1147,7 @@ static void create_object_entry(const struct object_id *oid,
{
struct object_entry *entry;
- entry = packlist_alloc(&to_pack, oid->hash, index_pos);
+ entry = packlist_alloc(&to_pack, oid, index_pos);
entry->hash = hash;
oe_set_type(entry, type);
if (exclude)