pack: move approximate object count to object store
The approximate_object_count() function maintains a rough count of objects in a repository to estimate how long object name abbreviates should be. Object names are scoped to a repository and the appropriate length may differ by repository, so the object count should not be global. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5508f69348
commit
9a00580d03
@ -99,6 +99,14 @@ struct raw_object_store {
|
||||
/* A most-recently-used ordered version of the packed_git list. */
|
||||
struct list_head packed_git_mru;
|
||||
|
||||
/*
|
||||
* A fast, rough count of the number of objects in the repository.
|
||||
* These two fields are not meant for direct access. Use
|
||||
* approximate_object_count() instead.
|
||||
*/
|
||||
unsigned long approximate_object_count;
|
||||
unsigned approximate_object_count_valid : 1;
|
||||
|
||||
/*
|
||||
* Whether packed_git has already been populated with this repository's
|
||||
* packs.
|
||||
|
Reference in New Issue
Block a user