mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
Currently ref lookups require loading the entire packed-refs file into a hashmap in memory. For repos with large numbers of refs this can be painfully slow. This patch replaces the existing lookup code and instead mmap()'s the packed-refs file and performs a binary search to locate the ref entry. Git uses a similiar approach. The old hash table codepath is still used for unsorted packed-refs files. This patch also fixes a minor bug where the "peeled" trait is never parsed correctly from the packed-refs header.
7 lines
323 B
Plaintext
Vendored
7 lines
323 B
Plaintext
Vendored
# pack-refs with: peeled fully-peeled sorted
|
|
c2596aa0151888587ec5c0187f261e63412d9e11 refs/foo/tag-outside-tags
|
|
^0df1a5865c8abfc09f1f2182e6a31be550e99f07
|
|
0df1a5865c8abfc09f1f2182e6a31be550e99f07 refs/heads/master
|
|
c2596aa0151888587ec5c0187f261e63412d9e11 refs/tags/tag-inside-tags
|
|
^0df1a5865c8abfc09f1f2182e6a31be550e99f07
|