Merge branch 'ps/fetch-pack-load-refs-optim'

Loading of ref tips to prepare for common ancestry negotiation in
"git fetch-pack" has been optimized by taking advantage of the
commit graph when available.

* ps/fetch-pack-load-refs-optim:
  fetch-pack: speed up loading of refs via commit graph
This commit is contained in:
Junio C Hamano 2021-08-24 15:32:41 -07:00
commit 1b2be06e04

View File

@ -137,8 +137,14 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
break;
}
}
if (type == OBJ_COMMIT)
return (struct commit *) parse_object(the_repository, oid);
if (type == OBJ_COMMIT) {
struct commit *commit = lookup_commit(the_repository, oid);
if (!commit || repo_parse_commit(the_repository, commit))
return NULL;
return commit;
}
return NULL;
}