diff options
author | Stefan Beller <sbeller@google.com> | 2018-03-23 18:21:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-26 19:05:55 +0200 |
commit | 9a00580d0383fe60c70e966e66584e626ca3a846 (patch) | |
tree | 3baff3d5f186ea0134d4b25acea0b23a37a2bd72 /object-store.h | |
parent | pack: move prepare_packed_git_run_once to object store (diff) | |
download | git-9a00580d0383fe60c70e966e66584e626ca3a846.tar.xz git-9a00580d0383fe60c70e966e66584e626ca3a846.zip |
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>
Diffstat (limited to 'object-store.h')
-rw-r--r-- | object-store.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/object-store.h b/object-store.h index 6a07a14d63..b53e125902 100644 --- a/object-store.h +++ b/object-store.h @@ -100,6 +100,14 @@ struct raw_object_store { 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. */ |