Merge branch 'jk/dont-count-existing-objects-twice'

There is a logic to estimate how many objects are in the
repository, which is mean to run once per process invocation, but
it ran every time the estimated value was requested.

* jk/dont-count-existing-objects-twice:
  packfile: actually set approximate_object_count_valid
This commit is contained in:
Junio C Hamano 2020-09-22 12:36:31 -07:00
Родитель 26a3728bed 67bb65de5d
Коммит 221b755f3a
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -923,6 +923,7 @@ unsigned long repo_approximate_object_count(struct repository *r)
count += p->num_objects; count += p->num_objects;
} }
r->objects->approximate_object_count = count; r->objects->approximate_object_count = count;
r->objects->approximate_object_count_valid = 1;
} }
return r->objects->approximate_object_count; return r->objects->approximate_object_count;
} }

Просмотреть файл

@ -73,6 +73,10 @@ do
git rev-list --objects --all >/dev/null git rev-list --objects --all >/dev/null
' '
test_perf "abbrev-commit ($nr_packs)" '
git rev-list --abbrev-commit HEAD >/dev/null
'
# This simulates the interesting part of the repack, which is the # This simulates the interesting part of the repack, which is the
# actual pack generation, without smudging the on-disk setup # actual pack generation, without smudging the on-disk setup
# between trials. # between trials.