return obj;
else if (obj->type == OBJ_NONE) {
if (type == OBJ_COMMIT)
- ((struct commit *)obj)->index = alloc_commit_index(r);
- obj->type = type;
+ init_commit_node(r, (struct commit *) obj);
+ else
+ obj->type = type;
return obj;
}
else {
(!obj && repo_has_object_file(r, oid) &&
oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
if (check_object_signature(repl, NULL, 0, NULL) < 0) {
- error(_("sha1 mismatch %s"), oid_to_hex(oid));
+ error(_("hash mismatch %s"), oid_to_hex(oid));
return NULL;
}
parse_blob_buffer(lookup_blob(r, oid), NULL, 0);
if (buffer) {
if (check_object_signature(repl, buffer, size, type_name(type)) < 0) {
free(buffer);
- error(_("sha1 mismatch %s"), oid_to_hex(repl));
+ error(_("hash mismatch %s"), oid_to_hex(repl));
return NULL;
}
clear_alloc_state(o->commit_state);
clear_alloc_state(o->tag_state);
clear_alloc_state(o->object_state);
+ stat_validity_clear(o->shallow_stat);
FREE_AND_NULL(o->blob_state);
FREE_AND_NULL(o->tree_state);
FREE_AND_NULL(o->commit_state);
FREE_AND_NULL(o->tag_state);
FREE_AND_NULL(o->object_state);
+ FREE_AND_NULL(o->shallow_stat);
}