]> git.ipfire.org Git - thirdparty/git.git/commit
t/perf: fix benchmarks with alternate repo formats
authorPatrick Steinhardt <ps@pks.im>
Mon, 28 Apr 2025 07:30:46 +0000 (09:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Apr 2025 20:13:51 +0000 (13:13 -0700)
commit5a6b9c81554a905b9798e4df1b2ab2e5a79a0c1f
treed6204318f8eafb6389ac9a235b03fa362e19caac
parentf65182a99e545d2f2bc22e6c1c2da192133b16a3
t/perf: fix benchmarks with alternate repo formats

Many of our benchmarks operate on a user-defined repository that we copy
over before running the benchmarked logic. To keep unintentional side
effects caused by on-disk state at bay we skip copying some files. This
includes for example hooks, but also the repo's configuration.

It is quite sensible to not copy over the configuration, as it is quite
easy to inadvertently carry over configuration that may significantly
impact the performance measurements. But we cannot fully ignore the
configuration either, as it may contain information about the repository
format. This will cause failures when for example using a repository
with SHA256 object format or the reftable ref format.

Fix the issue by parsing the reference and object formats from the
source repository and passing them to git-init(1).

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/perf-lib.sh