From e6a492b7beca9dc8b656f2be3aec23fc1a35e4de Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sat, 6 May 2017 22:10:11 +0000 Subject: pack: convert struct pack_idx_entry to struct object_id Convert struct pack_idx_entry to use struct object_id by changing the definition and applying the following semantic patch, plus the standard object_id transforms: @@ struct pack_idx_entry E1; @@ - E1.sha1 + E1.oid.hash @@ struct pack_idx_entry *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- pack-objects.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pack-objects.c') diff --git a/pack-objects.c b/pack-objects.c index 6398a8aa96..9558d13834 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -14,7 +14,7 @@ static uint32_t locate_object_entry_hash(struct packing_data *pdata, while (pdata->index[i] > 0) { uint32_t pos = pdata->index[i] - 1; - if (!hashcmp(sha1, pdata->objects[pos].idx.sha1)) { + if (!hashcmp(sha1, pdata->objects[pos].idx.oid.hash)) { *found = 1; return i; } @@ -53,7 +53,9 @@ static void rehash_objects(struct packing_data *pdata) for (i = 0; i < pdata->nr_objects; i++) { int found; - uint32_t ix = locate_object_entry_hash(pdata, entry->idx.sha1, &found); + uint32_t ix = locate_object_entry_hash(pdata, + entry->idx.oid.hash, + &found); if (found) die("BUG: Duplicate object in hash"); @@ -98,7 +100,7 @@ struct object_entry *packlist_alloc(struct packing_data *pdata, new_entry = pdata->objects + pdata->nr_objects++; memset(new_entry, 0, sizeof(*new_entry)); - hashcpy(new_entry->idx.sha1, sha1); + hashcpy(new_entry->idx.oid.hash, sha1); if (pdata->index_size * 3 <= pdata->nr_objects * 4) rehash_objects(pdata); -- cgit v1.2.1