mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
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:
commit
1b2be06e04
10
fetch-pack.c
10
fetch-pack.c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user