summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-05-06 22:10:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-08 06:12:57 (GMT)
commite6a492b7beca9dc8b656f2be3aec23fc1a35e4de (patch)
tree15196180251faf3c1416aa460172872c194ab08d /pack-objects.c
parentbc83266abe36905cade4719cbaeb8a62d0a382da (diff)
downloadgit-e6a492b7beca9dc8b656f2be3aec23fc1a35e4de.zip
git-e6a492b7beca9dc8b656f2be3aec23fc1a35e4de.tar.gz
git-e6a492b7beca9dc8b656f2be3aec23fc1a35e4de.tar.bz2
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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pack-objects.c b/pack-objects.c
index 6398a8a..9558d13 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);