Skip to content

Commit a93c141

Browse files
peffgitster
authored andcommitted
pack-objects: convert oe_set_delta_ext() to use object_id
We already store an object_id internally, and now our sole caller also has one. Let's stop passing around the internal hash array, which adds a bit of type safety. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3f83fd5 commit a93c141

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ static void check_object(struct object_entry *entry)
17561756
entry->delta_sibling_idx = base_entry->delta_child_idx;
17571757
SET_DELTA_CHILD(base_entry, entry);
17581758
} else {
1759-
SET_DELTA_EXT(entry, base_ref.hash);
1759+
SET_DELTA_EXT(entry, &base_ref);
17601760
}
17611761

17621762
unuse_pack(&w_curs);

pack-objects.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,14 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
203203

204204
void oe_set_delta_ext(struct packing_data *pdata,
205205
struct object_entry *delta,
206-
const unsigned char *sha1)
206+
const struct object_id *oid)
207207
{
208208
struct object_entry *base;
209209

210210
ALLOC_GROW(pdata->ext_bases, pdata->nr_ext + 1, pdata->alloc_ext);
211211
base = &pdata->ext_bases[pdata->nr_ext++];
212212
memset(base, 0, sizeof(*base));
213-
hashcpy(base->idx.oid.hash, sha1);
213+
oidcpy(&base->idx.oid, oid);
214214

215215
/* These flags mark that we are not part of the actual pack output. */
216216
base->preferred_base = 1;

pack-objects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static inline void oe_set_delta(struct packing_data *pack,
292292

293293
void oe_set_delta_ext(struct packing_data *pack,
294294
struct object_entry *e,
295-
const unsigned char *sha1);
295+
const struct object_id *oid);
296296

297297
static inline struct object_entry *oe_delta_child(
298298
const struct packing_data *pack,

0 commit comments

Comments
 (0)