summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
commit844a9ce47208de173341525c15a4c8c689dd278e (patch)
treed771915b28609179ddf1f3f911bcb30b7019d7cf /fsck.c
parentb12a966eff3f66337f83c117dbab8fa0cca16e4b (diff)
parentfcd30b138759a2ab5ecb55758c3341f0d608df2b (diff)
downloadgit-844a9ce47208de173341525c15a4c8c689dd278e.zip
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.gz
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.bz2
Merge branch 'bc/object-id'
More transition from "unsigned char[40]" to "struct object_id". This needed a few merge fixups, but is mostly disentangled from other topics. * bc/object-id: remote: convert functions to struct object_id Remove get_object_hash. Convert struct object to object_id Add several uses of get_object_hash. object: introduce get_object_hash macro. ref_newer: convert to use struct object_id push_refs_with_export: convert to struct object_id get_remote_heads: convert to struct object_id parse_fetch: convert to use struct object_id add_sought_entry_mem: convert to struct object_id Convert struct ref to use object_id. sha1_file: introduce has_object_file helper.
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fsck.c b/fsck.c
index 4060f1f..c637f66 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, object->oid.hash) >= 0)
return 0;
if (msg_type == FSCK_FATAL)
@@ -316,7 +316,7 @@ static int fsck_walk_tree(struct tree *tree, void *data, struct fsck_options *op
result = options->walk(&lookup_blob(entry.sha1)->object, OBJ_BLOB, data, options);
else {
result = error("in tree %s: entry %s has bad mode %.6o",
- sha1_to_hex(tree->object.sha1), entry.path, entry.mode);
+ oid_to_hex(&tree->object.oid), entry.path, entry.mode);
}
if (result < 0)
return result;
@@ -373,7 +373,7 @@ int fsck_walk(struct object *obj, void *data, struct fsck_options *options)
case OBJ_TAG:
return fsck_walk_tag((struct tag *)obj, data, options);
default:
- error("Unknown object type for %s", sha1_to_hex(obj->sha1));
+ error("Unknown object type for %s", oid_to_hex(&obj->oid));
return -1;
}
}
@@ -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(commit->object.oid.hash);
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(tag->object.oid.hash, &type, &size);
if (!buffer)
return report(options, &tag->object,
FSCK_MSG_MISSING_TAG_OBJECT,
@@ -810,9 +810,9 @@ int fsck_object(struct object *obj, void *data, unsigned long size,
int fsck_error_function(struct object *obj, int msg_type, const char *message)
{
if (msg_type == FSCK_WARN) {
- warning("object %s: %s", sha1_to_hex(obj->sha1), message);
+ warning("object %s: %s", oid_to_hex(&obj->oid), message);
return 0;
}
- error("object %s: %s", sha1_to_hex(obj->sha1), message);
+ error("object %s: %s", oid_to_hex(&obj->oid), message);
return 1;
}