This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Proposal: Make CommitObjects(), BlobObjects() and so on methods do not return unreachable objects due to performance problems. #1023
Open
Description
Right now, objects interator methods: TreeObjects()
, CommitObjects()
, BlobObjects()
, TagObjects()
are returning also unreachable objects.
This is because we are iterating the whole packfile, reading object headers, and returning only the ones that match with the requested type. This is causing really slow iterators on really large repositories because we are skipping constantly other objects.
To avoid that, we should just return objects that are referenced by a git reference.
Just as an example, on CommitObjects()
iterator we should simulate the git log --all
git command, that means, get all the hashes from references, and start walking the commit history.