]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/perf/fsmonitor: factor setup for fsmonitor into function
authorNipunn Koorapati <nipunn@dropbox.com>
Mon, 26 Oct 2020 19:32:50 +0000 (19:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Oct 2020 23:39:34 +0000 (16:39 -0700)
This prepares for it being called multiple times when
testing different hooks

Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/p7519-fsmonitor.sh

index 970caff3d24ef2f4028fa62026682e47ed91075b..087f66ecc21b574d7b9715ed50fd88272bf592ff 100755 (executable)
@@ -103,7 +103,7 @@ test_expect_success "one time repo setup" '
        fi
 '
 
-test_expect_success "setup for fsmonitor" '
+setup_for_fsmonitor() {
        # set INTEGRATION_SCRIPT depending on the environment
        if test -n "$GIT_PERF_7519_FSMONITOR"
        then
@@ -130,7 +130,7 @@ test_expect_success "setup for fsmonitor" '
        cat error &&
        [ ! -s error ] && # ensure no silent error
        git status  # Warm caches
-'
+}
 
 test_perf_w_drop_caches () {
        if test -n "$GIT_PERF_7519_DROP_CACHE"; then
@@ -188,6 +188,10 @@ test_fsmonitor_suite() {
        '
 }
 
+test_expect_success "setup for fsmonitor" '
+       setup_for_fsmonitor
+'
+
 test_fsmonitor_suite
 
 test_expect_success "setup without fsmonitor" '