Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues. * bc/object-id: (53 commits) object: convert parse_object* to take struct object_id tree: convert parse_tree_indirect to struct object_id sequencer: convert do_recursive_merge to struct object_id diff-lib: convert do_diff_cache to struct object_id builtin/ls-tree: convert to struct object_id merge: convert checkout_fast_forward to struct object_id sequencer: convert fast_forward_to to struct object_id builtin/ls-files: convert overlay_tree_on_cache to object_id builtin/read-tree: convert to struct object_id sha1_name: convert internals of peel_onion to object_id upload-pack: convert remaining parse_object callers to object_id revision: convert remaining parse_object callers to object_id revision: rename add_pending_sha1 to add_pending_oid http-push: convert process_ls_object and descendants to object_id refs/files-backend: convert many internals to struct object_id refs: convert struct ref_update to use struct object_id ref-filter: convert some static functions to struct object_id Convert struct ref_array_item to struct object_id Convert the verify_pack callback to struct object_id Convert lookup_tag to struct object_id ...
This commit is contained in:
@ -377,7 +377,7 @@ static int fsck_obj(struct object *obj)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsck_obj_buffer(const unsigned char *sha1, enum object_type type,
|
||||
static int fsck_obj_buffer(const struct object_id *oid, enum object_type type,
|
||||
unsigned long size, void *buffer, int *eaten)
|
||||
{
|
||||
/*
|
||||
@ -385,10 +385,10 @@ static int fsck_obj_buffer(const unsigned char *sha1, enum object_type type,
|
||||
* verify_packfile(), data_valid variable for details.
|
||||
*/
|
||||
struct object *obj;
|
||||
obj = parse_object_buffer(sha1, type, size, buffer, eaten);
|
||||
obj = parse_object_buffer(oid, type, size, buffer, eaten);
|
||||
if (!obj) {
|
||||
errors_found |= ERROR_OBJECT;
|
||||
return error("%s: object corrupt or missing", sha1_to_hex(sha1));
|
||||
return error("%s: object corrupt or missing", oid_to_hex(oid));
|
||||
}
|
||||
obj->flags = HAS_OBJ;
|
||||
return fsck_obj(obj);
|
||||
@ -444,7 +444,7 @@ static int fsck_handle_ref(const char *refname, const struct object_id *oid,
|
||||
{
|
||||
struct object *obj;
|
||||
|
||||
obj = parse_object(oid->hash);
|
||||
obj = parse_object(oid);
|
||||
if (!obj) {
|
||||
error("%s: invalid sha1 pointer %s", refname, oid_to_hex(oid));
|
||||
errors_found |= ERROR_REACHABLE;
|
||||
@ -506,7 +506,7 @@ static struct object *parse_loose_object(const struct object_id *oid,
|
||||
if (!contents && type != OBJ_BLOB)
|
||||
die("BUG: read_loose_object streamed a non-blob");
|
||||
|
||||
obj = parse_object_buffer(oid->hash, type, size, contents, &eaten);
|
||||
obj = parse_object_buffer(oid, type, size, contents, &eaten);
|
||||
|
||||
if (!eaten)
|
||||
free(contents);
|
||||
@ -599,10 +599,10 @@ static int fsck_cache_tree(struct cache_tree *it)
|
||||
fprintf(stderr, "Checking cache tree\n");
|
||||
|
||||
if (0 <= it->entry_count) {
|
||||
struct object *obj = parse_object(it->sha1);
|
||||
struct object *obj = parse_object(&it->oid);
|
||||
if (!obj) {
|
||||
error("%s: invalid sha1 pointer in cache-tree",
|
||||
sha1_to_hex(it->sha1));
|
||||
oid_to_hex(&it->oid));
|
||||
errors_found |= ERROR_REFS;
|
||||
return 1;
|
||||
}
|
||||
@ -781,7 +781,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
|
||||
mode = active_cache[i]->ce_mode;
|
||||
if (S_ISGITLINK(mode))
|
||||
continue;
|
||||
blob = lookup_blob(active_cache[i]->oid.hash);
|
||||
blob = lookup_blob(&active_cache[i]->oid);
|
||||
if (!blob)
|
||||
continue;
|
||||
obj = &blob->object;
|
||||
|
||||
Reference in New Issue
Block a user