t/perf/fsmonitor: separate one time repo initialization

In preparation for testing multiple fsmonitor hooks Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nipunn Koorapati committed Oct 26, 2020 at 19:32 UTC bb7cc7e754d1d7dc5d68977bcb565dd78f4592d5
1 file changed +11 -8
t/perf/p7519-fsmonitor.sh
+11 -8
@@ -68,7 +68,7 @@ then
68 fi
69 fi
70
71 -test_expect_success "setup for fsmonitor" '
71 +test_expect_success "one time repo setup" '
72 # set untrackedCache depending on the environment
73 if test -n "$GIT_PERF_7519_UNTRACKED_CACHE"
74 then
@@ -88,6 +88,16 @@ test_expect_success "setup for fsmonitor" '
88 git config core.splitIndex "$GIT_PERF_7519_SPLIT_INDEX"
89 fi &&
90
91 + mkdir 1_file 10_files 100_files 1000_files 10000_files &&
92 + for i in $(test_seq 1 10); do touch 10_files/$i; done &&
93 + for i in $(test_seq 1 100); do touch 100_files/$i; done &&
94 + for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
95 + for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
96 + git add 1_file 10_files 100_files 1000_files 10000_files &&
97 + git commit -m "Add files"
98 +'
99 +
100 +test_expect_success "setup for fsmonitor" '
101 # set INTEGRATION_SCRIPT depending on the environment
102 if test -n "$GIT_PERF_7519_FSMONITOR"
103 then
@@ -115,13 +125,6 @@ test_expect_success "setup for fsmonitor" '
125
126 git config core.fsmonitor "$INTEGRATION_SCRIPT" &&
127 git update-index --fsmonitor &&
118 - mkdir 1_file 10_files 100_files 1000_files 10000_files &&
119 - for i in $(test_seq 1 10); do touch 10_files/$i; done &&
120 - for i in $(test_seq 1 100); do touch 100_files/$i; done &&
121 - for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
122 - for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
123 - git add 1_file 10_files 100_files 1000_files 10000_files &&
124 - git commit -m "Add files" &&
128 git status # Warm caches
129 '
130