perf/run: add get_subsections()

This function makes it possible to find subsections, so that we will be able to run different tests for different subsections in a later commit. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Sep 23, 2017 at 19:55 UTC 2638441e075ffcb6467e754f085a6d285bc9cced
1 file changed +7
t/perf/run
+7
@@ -93,6 +93,13 @@ run_dirs () {
93 done
94 }
95
96 +get_subsections () {
97 + section="$1"
98 + test -z "$GIT_PERF_CONFIG_FILE" && return
99 + git config -f "$GIT_PERF_CONFIG_FILE" --name-only --get-regex "$section\..*\.[^.]+" |
100 + sed -e "s/$section\.\(.*\)\..*/\1/" | sort | uniq
101 +}
102 +
103 get_var_from_env_or_config () {
104 env_var="$1"
105 conf_var="$2"