From 7999b2cf772956466baa8925491d6fb1b0963292 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 10 Nov 2015 02:22:27 +0000 Subject: Add several uses of get_object_hash. Convert most instances where the sha1 member of struct object is dereferenced to use get_object_hash. Most instances that are passed to functions that have versions taking struct object_id, such as get_sha1_hex/get_oid_hex, or instances that can be trivially converted to use struct object_id instead, are not converted. Signed-off-by: brian m. carlson Signed-off-by: Jeff King --- builtin/pack-objects.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'builtin/pack-objects.c') diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 1c63f8f28..b2d3e4ea2 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2277,7 +2277,7 @@ static void read_object_list_from_stdin(void) static void show_commit(struct commit *commit, void *data) { - add_object_entry(commit->object.sha1, OBJ_COMMIT, NULL, 0); + add_object_entry(get_object_hash(commit->object), OBJ_COMMIT, NULL, 0); commit->object.flags |= OBJECT_ADDED; if (write_bitmap_index) @@ -2291,7 +2291,7 @@ static void show_object(struct object *obj, char *name = path_name(path, last); add_preferred_base_object(name); - add_object_entry(obj->sha1, obj->type, name, 0); + add_object_entry(get_object_hash(*obj), obj->type, name, 0); obj->flags |= OBJECT_ADDED; /* @@ -2303,7 +2303,7 @@ static void show_object(struct object *obj, static void show_edge(struct commit *commit) { - add_preferred_base(commit->object.sha1); + add_preferred_base(get_object_hash(commit->object)); } struct in_pack_object { @@ -2319,7 +2319,7 @@ struct in_pack { static void mark_in_pack_object(struct object *object, struct packed_git *p, struct in_pack *in_pack) { - in_pack->array[in_pack->nr].offset = find_pack_entry_one(object->sha1, p); + in_pack->array[in_pack->nr].offset = find_pack_entry_one(get_object_hash(*object), p); in_pack->array[in_pack->nr].object = object; in_pack->nr++; } @@ -2376,7 +2376,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs) ofscmp); for (i = 0; i < in_pack.nr; i++) { struct object *o = in_pack.array[i].object; - add_object_entry(o->sha1, o->type, "", 0); + add_object_entry(get_object_hash(*o), o->type, "", 0); } } free(in_pack.array); @@ -2484,12 +2484,12 @@ static void record_recent_object(struct object *obj, const char *last, void *data) { - sha1_array_append(&recent_objects, obj->sha1); + sha1_array_append(&recent_objects, get_object_hash(*obj)); } static void record_recent_commit(struct commit *commit, void *data) { - sha1_array_append(&recent_objects, commit->object.sha1); + sha1_array_append(&recent_objects, get_object_hash(commit->object)); } static void get_object_list(int ac, const char **av) -- cgit v1.2.1