mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
Merge branch 'ap/packfile-promisor-object-optim'
The code path that enumerates promisor objects have been optimized to skip pointlessly parsing blob objects. * ap/packfile-promisor-object-optim: packfile: skip hash checks in add_promisor_object() object: apply skip_hash and discard_tree optimizations to unknown blobs too
This commit is contained in:
4
object.c
4
object.c
@@ -328,7 +328,7 @@ struct object *parse_object_with_flags(struct repository *r,
|
|||||||
return &commit->object;
|
return &commit->object;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!obj || obj->type == OBJ_BLOB) &&
|
if ((!obj || obj->type == OBJ_NONE || obj->type == OBJ_BLOB) &&
|
||||||
odb_read_object_info(r->objects, oid, NULL) == OBJ_BLOB) {
|
odb_read_object_info(r->objects, oid, NULL) == OBJ_BLOB) {
|
||||||
if (!skip_hash && stream_object_signature(r, repl) < 0) {
|
if (!skip_hash && stream_object_signature(r, repl) < 0) {
|
||||||
error(_("hash mismatch %s"), oid_to_hex(oid));
|
error(_("hash mismatch %s"), oid_to_hex(oid));
|
||||||
@@ -344,7 +344,7 @@ struct object *parse_object_with_flags(struct repository *r,
|
|||||||
* have the on-disk object with the correct type.
|
* have the on-disk object with the correct type.
|
||||||
*/
|
*/
|
||||||
if (skip_hash && discard_tree &&
|
if (skip_hash && discard_tree &&
|
||||||
(!obj || obj->type == OBJ_TREE) &&
|
(!obj || obj->type == OBJ_NONE || obj->type == OBJ_TREE) &&
|
||||||
odb_read_object_info(r->objects, oid, NULL) == OBJ_TREE) {
|
odb_read_object_info(r->objects, oid, NULL) == OBJ_TREE) {
|
||||||
return &lookup_tree(r, oid)->object;
|
return &lookup_tree(r, oid)->object;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2333,7 +2333,8 @@ static int add_promisor_object(const struct object_id *oid,
|
|||||||
we_parsed_object = 0;
|
we_parsed_object = 0;
|
||||||
} else {
|
} else {
|
||||||
we_parsed_object = 1;
|
we_parsed_object = 1;
|
||||||
obj = parse_object(pack->repo, oid);
|
obj = parse_object_with_flags(pack->repo, oid,
|
||||||
|
PARSE_OBJECT_SKIP_HASH_CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user