summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:27 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commit7999b2cf772956466baa8925491d6fb1b0963292 (patch)
tree34a3bf75c3cdc621d732107f53181ff28c0550a4 /fsck.c
parent3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff)
downloadgit-7999b2cf772956466baa8925491d6fb1b0963292.tar.gz
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 <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fsck.c b/fsck.c
index e41e753d6d..baa7f2989c 100644
--- a/fsck.c
+++ b/fsck.c
@@ -276,7 +276,7 @@ static int report(struct fsck_options *options, struct object *object,
return 0;
if (options->skiplist && object &&
- sha1_array_lookup(options->skiplist, object->sha1) >= 0)
+ sha1_array_lookup(options->skiplist, get_object_hash(*object)) >= 0)
return 0;
if (msg_type == FSCK_FATAL)
@@ -630,7 +630,7 @@ static int fsck_commit_buffer(struct commit *commit, const char *buffer,
buffer += 41;
parent_line_count++;
}
- graft = lookup_commit_graft(commit->object.sha1);
+ graft = lookup_commit_graft(get_object_hash(commit->object));
parent_count = commit_list_count(commit->parents);
if (graft) {
if (graft->nr_parent == -1 && !parent_count)
@@ -696,7 +696,7 @@ static int fsck_tag_buffer(struct tag *tag, const char *data,
enum object_type type;
buffer = to_free =
- read_sha1_file(tag->object.sha1, &type, &size);
+ read_sha1_file(get_object_hash(tag->object), &type, &size);
if (!buffer)
return report(options, &tag->object,
FSCK_MSG_MISSING_TAG_OBJECT,