Skip to content

Commit 8bb81cc

Browse files
committed
Merge branch 'js/git-perf-env-override'
Developer support fix.. * js/git-perf-env-override: perf: do allow `GIT_PERF_*` to be overridden again
2 parents f65182a + 32b74b9 commit 8bb81cc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/perf/perf-lib.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ TEST_OUTPUT_DIRECTORY=$(pwd)
2525
TEST_NO_CREATE_REPO=t
2626
TEST_NO_MALLOC_CHECK=t
2727

28+
# GIT-BUILD-OPTIONS, sourced by test-lib.sh, overwrites the `GIT_PERF_*`
29+
# values that are set by the user (if any). Let's stash them away as
30+
# `eval`-able assignments.
31+
git_perf_settings="$(env |
32+
sed -n "/^GIT_PERF_/{
33+
# escape all single-quotes in the value
34+
s/'/'\\\\''/g
35+
# turn this into an eval-able assignment
36+
s/^\\([^=]*=\\)\\(.*\\)/\\1'\\2'/p
37+
}")"
38+
2839
. ../test-lib.sh
40+
eval "$git_perf_settings"
2941

3042
unset GIT_CONFIG_NOSYSTEM
3143
GIT_CONFIG_SYSTEM="$TEST_DIRECTORY/perf/config"

0 commit comments

Comments
 (0)