]>
Commit | Line | Data |
---|---|---|
2057d750 DS |
1 | #!/bin/sh |
2 | ||
3 | test_description='git maintenance builtin' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
663b2b1b | 7 | GIT_TEST_COMMIT_GRAPH=0 |
52fe41ff | 8 | GIT_TEST_MULTI_PACK_INDEX=0 |
663b2b1b | 9 | |
2afe7e35 DS |
10 | test_lazy_prereq XMLLINT ' |
11 | xmllint --version | |
12 | ' | |
13 | ||
14 | test_xmllint () { | |
15 | if test_have_prereq XMLLINT | |
16 | then | |
17 | xmllint --noout "$@" | |
18 | else | |
19 | true | |
20 | fi | |
21 | } | |
22 | ||
b681b191 | 23 | test_lazy_prereq SYSTEMD_ANALYZE ' |
670e5973 | 24 | systemd-analyze verify /lib/systemd/system/basic.target |
b681b191 LH |
25 | ' |
26 | ||
27 | test_systemd_analyze_verify () { | |
28 | if test_have_prereq SYSTEMD_ANALYZE | |
29 | then | |
30 | systemd-analyze verify "$@" | |
31 | fi | |
32 | } | |
33 | ||
2057d750 | 34 | test_expect_success 'help text' ' |
03509544 | 35 | test_expect_code 129 git maintenance -h >actual && |
6789275d | 36 | test_grep "usage: git maintenance <subcommand>" actual && |
03509544 | 37 | test_expect_code 129 git maintenance barf 2>err && |
6789275d JH |
38 | test_grep "unknown subcommand: \`barf'\''" err && |
39 | test_grep "usage: git maintenance" err && | |
2057d750 | 40 | test_expect_code 129 git maintenance 2>err && |
6789275d JH |
41 | test_grep "error: need a subcommand" err && |
42 | test_grep "usage: git maintenance" err | |
2057d750 DS |
43 | ' |
44 | ||
3ddaad0e DS |
45 | test_expect_success 'run [--auto|--quiet]' ' |
46 | GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" \ | |
47 | git maintenance run 2>/dev/null && | |
48 | GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" \ | |
49 | git maintenance run --auto 2>/dev/null && | |
50 | GIT_TRACE2_EVENT="$(pwd)/run-no-quiet.txt" \ | |
51 | git maintenance run --no-quiet 2>/dev/null && | |
52 | test_subcommand git gc --quiet <run-no-auto.txt && | |
916d0626 | 53 | test_subcommand ! git gc --auto --quiet <run-auto.txt && |
3ddaad0e | 54 | test_subcommand git gc --no-quiet <run-no-quiet.txt |
2057d750 DS |
55 | ' |
56 | ||
1942d483 DS |
57 | test_expect_success 'maintenance.auto config option' ' |
58 | GIT_TRACE2_EVENT="$(pwd)/default" git commit --quiet --allow-empty -m 1 && | |
59 | test_subcommand git maintenance run --auto --quiet <default && | |
60 | GIT_TRACE2_EVENT="$(pwd)/true" \ | |
61 | git -c maintenance.auto=true \ | |
62 | commit --quiet --allow-empty -m 2 && | |
63 | test_subcommand git maintenance run --auto --quiet <true && | |
64 | GIT_TRACE2_EVENT="$(pwd)/false" \ | |
65 | git -c maintenance.auto=false \ | |
66 | commit --quiet --allow-empty -m 3 && | |
67 | test_subcommand ! git maintenance run --auto --quiet <false | |
68 | ' | |
69 | ||
74e12192 KH |
70 | test_expect_success 'register uses XDG_CONFIG_HOME config if it exists' ' |
71 | test_when_finished rm -r .config/git/config && | |
72 | ( | |
73 | XDG_CONFIG_HOME=.config && | |
74 | export XDG_CONFIG_HOME && | |
75 | mkdir -p $XDG_CONFIG_HOME/git && | |
76 | >$XDG_CONFIG_HOME/git/config && | |
77 | git maintenance register && | |
78 | git config --file=$XDG_CONFIG_HOME/git/config --get maintenance.repo >actual && | |
79 | pwd >expect && | |
80 | test_cmp expect actual | |
81 | ) | |
82 | ' | |
83 | ||
84 | test_expect_success 'register does not need XDG_CONFIG_HOME config to exist' ' | |
85 | test_when_finished git maintenance unregister && | |
86 | test_path_is_missing $XDG_CONFIG_HOME/git/config && | |
87 | git maintenance register && | |
88 | git config --global --get maintenance.repo >actual && | |
89 | pwd >expect && | |
90 | test_cmp expect actual | |
91 | ' | |
92 | ||
93 | test_expect_success 'unregister uses XDG_CONFIG_HOME config if it exists' ' | |
94 | test_when_finished rm -r .config/git/config && | |
95 | ( | |
96 | XDG_CONFIG_HOME=.config && | |
97 | export XDG_CONFIG_HOME && | |
98 | mkdir -p $XDG_CONFIG_HOME/git && | |
99 | >$XDG_CONFIG_HOME/git/config && | |
100 | git maintenance register && | |
101 | git maintenance unregister && | |
102 | test_must_fail git config --file=$XDG_CONFIG_HOME/git/config --get maintenance.repo >actual && | |
103 | test_must_be_empty actual | |
104 | ) | |
105 | ' | |
106 | ||
107 | test_expect_success 'unregister does not need XDG_CONFIG_HOME config to exist' ' | |
108 | test_path_is_missing $XDG_CONFIG_HOME/git/config && | |
109 | git maintenance register && | |
110 | git maintenance unregister && | |
111 | test_must_fail git config --global --get maintenance.repo >actual && | |
112 | test_must_be_empty actual | |
113 | ' | |
114 | ||
65d655b5 DS |
115 | test_expect_success 'maintenance.<task>.enabled' ' |
116 | git config maintenance.gc.enabled false && | |
117 | git config maintenance.commit-graph.enabled true && | |
118 | GIT_TRACE2_EVENT="$(pwd)/run-config.txt" git maintenance run 2>err && | |
119 | test_subcommand ! git gc --quiet <run-config.txt && | |
120 | test_subcommand git commit-graph write --split --reachable --no-progress <run-config.txt | |
121 | ' | |
122 | ||
090511bc DS |
123 | test_expect_success 'run --task=<task>' ' |
124 | GIT_TRACE2_EVENT="$(pwd)/run-commit-graph.txt" \ | |
125 | git maintenance run --task=commit-graph 2>/dev/null && | |
126 | GIT_TRACE2_EVENT="$(pwd)/run-gc.txt" \ | |
127 | git maintenance run --task=gc 2>/dev/null && | |
128 | GIT_TRACE2_EVENT="$(pwd)/run-commit-graph.txt" \ | |
129 | git maintenance run --task=commit-graph 2>/dev/null && | |
130 | GIT_TRACE2_EVENT="$(pwd)/run-both.txt" \ | |
131 | git maintenance run --task=commit-graph --task=gc 2>/dev/null && | |
132 | test_subcommand ! git gc --quiet <run-commit-graph.txt && | |
133 | test_subcommand git gc --quiet <run-gc.txt && | |
134 | test_subcommand git gc --quiet <run-both.txt && | |
135 | test_subcommand git commit-graph write --split --reachable --no-progress <run-commit-graph.txt && | |
136 | test_subcommand ! git commit-graph write --split --reachable --no-progress <run-gc.txt && | |
137 | test_subcommand git commit-graph write --split --reachable --no-progress <run-both.txt | |
138 | ' | |
139 | ||
d334107c DS |
140 | test_expect_success 'core.commitGraph=false prevents write process' ' |
141 | GIT_TRACE2_EVENT="$(pwd)/no-commit-graph.txt" \ | |
142 | git -c core.commitGraph=false maintenance run \ | |
143 | --task=commit-graph 2>/dev/null && | |
144 | test_subcommand ! git commit-graph write --split --reachable --no-progress \ | |
145 | <no-commit-graph.txt | |
146 | ' | |
147 | ||
8f801804 DS |
148 | test_expect_success 'commit-graph auto condition' ' |
149 | COMMAND="maintenance run --task=commit-graph --auto --quiet" && | |
150 | ||
151 | GIT_TRACE2_EVENT="$(pwd)/cg-no.txt" \ | |
152 | git -c maintenance.commit-graph.auto=1 $COMMAND && | |
153 | GIT_TRACE2_EVENT="$(pwd)/cg-negative-means-yes.txt" \ | |
154 | git -c maintenance.commit-graph.auto="-1" $COMMAND && | |
155 | ||
156 | test_commit first && | |
157 | ||
158 | GIT_TRACE2_EVENT="$(pwd)/cg-zero-means-no.txt" \ | |
159 | git -c maintenance.commit-graph.auto=0 $COMMAND && | |
160 | GIT_TRACE2_EVENT="$(pwd)/cg-one-satisfied.txt" \ | |
161 | git -c maintenance.commit-graph.auto=1 $COMMAND && | |
162 | ||
163 | git commit --allow-empty -m "second" && | |
164 | git commit --allow-empty -m "third" && | |
165 | ||
166 | GIT_TRACE2_EVENT="$(pwd)/cg-two-satisfied.txt" \ | |
167 | git -c maintenance.commit-graph.auto=2 $COMMAND && | |
168 | ||
169 | COMMIT_GRAPH_WRITE="git commit-graph write --split --reachable --no-progress" && | |
170 | test_subcommand ! $COMMIT_GRAPH_WRITE <cg-no.txt && | |
171 | test_subcommand $COMMIT_GRAPH_WRITE <cg-negative-means-yes.txt && | |
172 | test_subcommand ! $COMMIT_GRAPH_WRITE <cg-zero-means-no.txt && | |
173 | test_subcommand $COMMIT_GRAPH_WRITE <cg-one-satisfied.txt && | |
174 | test_subcommand $COMMIT_GRAPH_WRITE <cg-two-satisfied.txt | |
175 | ' | |
176 | ||
090511bc DS |
177 | test_expect_success 'run --task=bogus' ' |
178 | test_must_fail git maintenance run --task=bogus 2>err && | |
6789275d | 179 | test_grep "is not a valid task" err |
090511bc DS |
180 | ' |
181 | ||
182 | test_expect_success 'run --task duplicate' ' | |
183 | test_must_fail git maintenance run --task=gc --task=gc 2>err && | |
6789275d | 184 | test_grep "cannot be selected multiple times" err |
090511bc DS |
185 | ' |
186 | ||
28cb5e66 DS |
187 | test_expect_success 'run --task=prefetch with no remotes' ' |
188 | git maintenance run --task=prefetch 2>err && | |
189 | test_must_be_empty err | |
190 | ' | |
191 | ||
192 | test_expect_success 'prefetch multiple remotes' ' | |
193 | git clone . clone1 && | |
194 | git clone . clone2 && | |
195 | git remote add remote1 "file://$(pwd)/clone1" && | |
196 | git remote add remote2 "file://$(pwd)/clone2" && | |
197 | git -C clone1 switch -c one && | |
198 | git -C clone2 switch -c two && | |
199 | test_commit -C clone1 one && | |
200 | test_commit -C clone2 two && | |
201 | GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && | |
cfd781ea DS |
202 | fetchargs="--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet" && |
203 | test_subcommand git fetch remote1 $fetchargs <run-prefetch.txt && | |
204 | test_subcommand git fetch remote2 $fetchargs <run-prefetch.txt && | |
170ba45a PS |
205 | git for-each-ref refs/remotes >actual && |
206 | test_must_be_empty actual && | |
cfd781ea DS |
207 | git log prefetch/remotes/remote1/one && |
208 | git log prefetch/remotes/remote2/two && | |
28cb5e66 | 209 | git fetch --all && |
cfd781ea DS |
210 | test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one && |
211 | test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two && | |
96eaffeb | 212 | |
96eaffeb | 213 | git log --oneline --decorate --all >log && |
32f67888 DS |
214 | ! grep "prefetch" log && |
215 | ||
216 | test_when_finished git config --unset remote.remote1.skipFetchAll && | |
217 | git config remote.remote1.skipFetchAll true && | |
218 | GIT_TRACE2_EVENT="$(pwd)/skip-remote1.txt" git maintenance run --task=prefetch 2>/dev/null && | |
219 | test_subcommand ! git fetch remote1 $fetchargs <skip-remote1.txt && | |
220 | test_subcommand git fetch remote2 $fetchargs <skip-remote1.txt | |
96eaffeb DS |
221 | ' |
222 | ||
252cfb7c DS |
223 | test_expect_success 'loose-objects task' ' |
224 | # Repack everything so we know the state of the object dir | |
225 | git repack -adk && | |
226 | ||
227 | # Hack to stop maintenance from running during "git commit" | |
228 | echo in use >.git/objects/maintenance.lock && | |
229 | ||
230 | # Assuming that "git commit" creates at least one loose object | |
231 | test_commit create-loose-object && | |
232 | rm .git/objects/maintenance.lock && | |
233 | ||
234 | ls .git/objects >obj-dir-before && | |
235 | test_file_not_empty obj-dir-before && | |
236 | ls .git/objects/pack/*.pack >packs-before && | |
237 | test_line_count = 1 packs-before && | |
238 | ||
239 | # The first run creates a pack-file | |
240 | # but does not delete loose objects. | |
241 | git maintenance run --task=loose-objects && | |
242 | ls .git/objects >obj-dir-between && | |
243 | test_cmp obj-dir-before obj-dir-between && | |
244 | ls .git/objects/pack/*.pack >packs-between && | |
245 | test_line_count = 2 packs-between && | |
246 | ls .git/objects/pack/loose-*.pack >loose-packs && | |
247 | test_line_count = 1 loose-packs && | |
248 | ||
249 | # The second run deletes loose objects | |
250 | # but does not create a pack-file. | |
251 | git maintenance run --task=loose-objects && | |
252 | ls .git/objects >obj-dir-after && | |
253 | cat >expect <<-\EOF && | |
254 | info | |
255 | pack | |
256 | EOF | |
257 | test_cmp expect obj-dir-after && | |
258 | ls .git/objects/pack/*.pack >packs-after && | |
259 | test_cmp packs-between packs-after | |
260 | ' | |
261 | ||
3e220e60 DS |
262 | test_expect_success 'maintenance.loose-objects.auto' ' |
263 | git repack -adk && | |
264 | GIT_TRACE2_EVENT="$(pwd)/trace-lo1.txt" \ | |
265 | git -c maintenance.loose-objects.auto=1 maintenance \ | |
266 | run --auto --task=loose-objects 2>/dev/null && | |
267 | test_subcommand ! git prune-packed --quiet <trace-lo1.txt && | |
268 | printf data-A | git hash-object -t blob --stdin -w && | |
269 | GIT_TRACE2_EVENT="$(pwd)/trace-loA" \ | |
270 | git -c maintenance.loose-objects.auto=2 \ | |
271 | maintenance run --auto --task=loose-objects 2>/dev/null && | |
272 | test_subcommand ! git prune-packed --quiet <trace-loA && | |
273 | printf data-B | git hash-object -t blob --stdin -w && | |
274 | GIT_TRACE2_EVENT="$(pwd)/trace-loB" \ | |
275 | git -c maintenance.loose-objects.auto=2 \ | |
276 | maintenance run --auto --task=loose-objects 2>/dev/null && | |
277 | test_subcommand git prune-packed --quiet <trace-loB && | |
278 | GIT_TRACE2_EVENT="$(pwd)/trace-loC" \ | |
279 | git -c maintenance.loose-objects.auto=2 \ | |
280 | maintenance run --auto --task=loose-objects 2>/dev/null && | |
281 | test_subcommand git prune-packed --quiet <trace-loC | |
282 | ' | |
283 | ||
52fe41ff DS |
284 | test_expect_success 'incremental-repack task' ' |
285 | packDir=.git/objects/pack && | |
286 | for i in $(test_seq 1 5) | |
287 | do | |
288 | test_commit $i || return 1 | |
289 | done && | |
290 | ||
291 | # Create three disjoint pack-files with size BIG, small, small. | |
292 | echo HEAD~2 | git pack-objects --revs $packDir/test-1 && | |
293 | test_tick && | |
294 | git pack-objects --revs $packDir/test-2 <<-\EOF && | |
295 | HEAD~1 | |
296 | ^HEAD~2 | |
297 | EOF | |
298 | test_tick && | |
299 | git pack-objects --revs $packDir/test-3 <<-\EOF && | |
300 | HEAD | |
301 | ^HEAD~1 | |
302 | EOF | |
3cf5f221 DS |
303 | |
304 | # Delete refs that have not been repacked in these packs. | |
305 | git for-each-ref --format="delete %(refname)" \ | |
b4724242 | 306 | refs/prefetch refs/tags refs/remotes >refs && |
3cf5f221 DS |
307 | git update-ref --stdin <refs && |
308 | ||
309 | # Replace the object directory with this pack layout. | |
52fe41ff DS |
310 | rm -f $packDir/pack-* && |
311 | rm -f $packDir/loose-* && | |
312 | ls $packDir/*.pack >packs-before && | |
313 | test_line_count = 3 packs-before && | |
314 | ||
b4724242 JK |
315 | # make sure we do not have any broken refs that were |
316 | # missed in the deletion above | |
317 | git for-each-ref && | |
318 | ||
52fe41ff DS |
319 | # the job repacks the two into a new pack, but does not |
320 | # delete the old ones. | |
321 | git maintenance run --task=incremental-repack && | |
322 | ls $packDir/*.pack >packs-between && | |
323 | test_line_count = 4 packs-between && | |
324 | ||
325 | # the job deletes the two old packs, and does not write | |
a13e3d0e DS |
326 | # a new one because the batch size is not high enough to |
327 | # pack the largest pack-file. | |
52fe41ff DS |
328 | git maintenance run --task=incremental-repack && |
329 | ls .git/objects/pack/*.pack >packs-after && | |
a13e3d0e DS |
330 | test_line_count = 2 packs-after |
331 | ' | |
332 | ||
333 | test_expect_success EXPENSIVE 'incremental-repack 2g limit' ' | |
a0c5ccc1 JK |
334 | test_config core.compression 0 && |
335 | ||
a13e3d0e DS |
336 | for i in $(test_seq 1 5) |
337 | do | |
338 | test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || | |
339 | return 1 | |
340 | done && | |
341 | git add big && | |
a0c5ccc1 | 342 | git commit -qm "Add big file (1)" && |
a13e3d0e DS |
343 | |
344 | # ensure any possible loose objects are in a pack-file | |
345 | git maintenance run --task=loose-objects && | |
346 | ||
347 | rm big && | |
348 | for i in $(test_seq 6 10) | |
349 | do | |
350 | test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || | |
351 | return 1 | |
352 | done && | |
353 | git add big && | |
a0c5ccc1 | 354 | git commit -qm "Add big file (2)" && |
a13e3d0e DS |
355 | |
356 | # ensure any possible loose objects are in a pack-file | |
357 | git maintenance run --task=loose-objects && | |
358 | ||
359 | # Now run the incremental-repack task and check the batch-size | |
360 | GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \ | |
361 | --task=incremental-repack 2>/dev/null && | |
362 | test_subcommand git multi-pack-index repack \ | |
363 | --no-progress --batch-size=2147483647 <run-2g.txt | |
52fe41ff DS |
364 | ' |
365 | ||
a897ab7e GC |
366 | run_incremental_repack_and_verify () { |
367 | test_commit A && | |
e841a79a | 368 | git repack -adk && |
e841a79a DS |
369 | git multi-pack-index write && |
370 | GIT_TRACE2_EVENT="$(pwd)/midx-init.txt" git \ | |
371 | -c maintenance.incremental-repack.auto=1 \ | |
372 | maintenance run --auto --task=incremental-repack 2>/dev/null && | |
373 | test_subcommand ! git multi-pack-index write --no-progress <midx-init.txt && | |
a897ab7e | 374 | test_commit B && |
e841a79a DS |
375 | git pack-objects --revs .git/objects/pack/pack <<-\EOF && |
376 | HEAD | |
377 | ^HEAD~1 | |
378 | EOF | |
379 | GIT_TRACE2_EVENT=$(pwd)/trace-A git \ | |
380 | -c maintenance.incremental-repack.auto=2 \ | |
381 | maintenance run --auto --task=incremental-repack 2>/dev/null && | |
382 | test_subcommand ! git multi-pack-index write --no-progress <trace-A && | |
a897ab7e | 383 | test_commit C && |
e841a79a DS |
384 | git pack-objects --revs .git/objects/pack/pack <<-\EOF && |
385 | HEAD | |
386 | ^HEAD~1 | |
387 | EOF | |
388 | GIT_TRACE2_EVENT=$(pwd)/trace-B git \ | |
389 | -c maintenance.incremental-repack.auto=2 \ | |
390 | maintenance run --auto --task=incremental-repack 2>/dev/null && | |
391 | test_subcommand git multi-pack-index write --no-progress <trace-B | |
a897ab7e GC |
392 | } |
393 | ||
394 | test_expect_success 'maintenance.incremental-repack.auto' ' | |
395 | rm -rf incremental-repack-true && | |
396 | git init incremental-repack-true && | |
397 | ( | |
398 | cd incremental-repack-true && | |
399 | git config core.multiPackIndex true && | |
400 | run_incremental_repack_and_verify | |
401 | ) | |
402 | ' | |
403 | ||
404 | test_expect_success 'maintenance.incremental-repack.auto (when config is unset)' ' | |
405 | rm -rf incremental-repack-unset && | |
406 | git init incremental-repack-unset && | |
407 | ( | |
408 | cd incremental-repack-unset && | |
409 | test_unconfig core.multiPackIndex && | |
410 | run_incremental_repack_and_verify | |
411 | ) | |
e841a79a DS |
412 | ' |
413 | ||
41abfe15 DS |
414 | test_expect_success 'pack-refs task' ' |
415 | for n in $(test_seq 1 5) | |
416 | do | |
417 | git branch -f to-pack/$n HEAD || return 1 | |
418 | done && | |
419 | GIT_TRACE2_EVENT="$(pwd)/pack-refs.txt" \ | |
420 | git maintenance run --task=pack-refs && | |
41abfe15 DS |
421 | test_subcommand git pack-refs --all --prune <pack-refs.txt |
422 | ' | |
423 | ||
b08ff1fe DS |
424 | test_expect_success '--auto and --schedule incompatible' ' |
425 | test_must_fail git maintenance run --auto --schedule=daily 2>err && | |
6789275d | 426 | test_grep "at most one" err |
b08ff1fe DS |
427 | ' |
428 | ||
429 | test_expect_success 'invalid --schedule value' ' | |
430 | test_must_fail git maintenance run --schedule=annually 2>err && | |
6789275d | 431 | test_grep "unrecognized --schedule" err |
b08ff1fe DS |
432 | ' |
433 | ||
434 | test_expect_success '--schedule inheritance weekly -> daily -> hourly' ' | |
435 | git config maintenance.loose-objects.enabled true && | |
436 | git config maintenance.loose-objects.schedule hourly && | |
437 | git config maintenance.commit-graph.enabled true && | |
438 | git config maintenance.commit-graph.schedule daily && | |
439 | git config maintenance.incremental-repack.enabled true && | |
440 | git config maintenance.incremental-repack.schedule weekly && | |
441 | ||
442 | GIT_TRACE2_EVENT="$(pwd)/hourly.txt" \ | |
443 | git maintenance run --schedule=hourly 2>/dev/null && | |
444 | test_subcommand git prune-packed --quiet <hourly.txt && | |
445 | test_subcommand ! git commit-graph write --split --reachable \ | |
446 | --no-progress <hourly.txt && | |
447 | test_subcommand ! git multi-pack-index write --no-progress <hourly.txt && | |
448 | ||
449 | GIT_TRACE2_EVENT="$(pwd)/daily.txt" \ | |
450 | git maintenance run --schedule=daily 2>/dev/null && | |
451 | test_subcommand git prune-packed --quiet <daily.txt && | |
452 | test_subcommand git commit-graph write --split --reachable \ | |
453 | --no-progress <daily.txt && | |
454 | test_subcommand ! git multi-pack-index write --no-progress <daily.txt && | |
455 | ||
456 | GIT_TRACE2_EVENT="$(pwd)/weekly.txt" \ | |
457 | git maintenance run --schedule=weekly 2>/dev/null && | |
458 | test_subcommand git prune-packed --quiet <weekly.txt && | |
459 | test_subcommand git commit-graph write --split --reachable \ | |
460 | --no-progress <weekly.txt && | |
461 | test_subcommand git multi-pack-index write --no-progress <weekly.txt | |
462 | ' | |
463 | ||
a4cb1a23 DS |
464 | test_expect_success 'maintenance.strategy inheritance' ' |
465 | for task in commit-graph loose-objects incremental-repack | |
466 | do | |
467 | git config --unset maintenance.$task.schedule || return 1 | |
468 | done && | |
469 | ||
470 | test_when_finished git config --unset maintenance.strategy && | |
471 | git config maintenance.strategy incremental && | |
472 | ||
473 | GIT_TRACE2_EVENT="$(pwd)/incremental-hourly.txt" \ | |
474 | git maintenance run --schedule=hourly --quiet && | |
475 | GIT_TRACE2_EVENT="$(pwd)/incremental-daily.txt" \ | |
476 | git maintenance run --schedule=daily --quiet && | |
acc1c4d5 DS |
477 | GIT_TRACE2_EVENT="$(pwd)/incremental-weekly.txt" \ |
478 | git maintenance run --schedule=weekly --quiet && | |
a4cb1a23 DS |
479 | |
480 | test_subcommand git commit-graph write --split --reachable \ | |
481 | --no-progress <incremental-hourly.txt && | |
482 | test_subcommand ! git prune-packed --quiet <incremental-hourly.txt && | |
483 | test_subcommand ! git multi-pack-index write --no-progress \ | |
484 | <incremental-hourly.txt && | |
acc1c4d5 DS |
485 | test_subcommand ! git pack-refs --all --prune \ |
486 | <incremental-hourly.txt && | |
a4cb1a23 DS |
487 | |
488 | test_subcommand git commit-graph write --split --reachable \ | |
489 | --no-progress <incremental-daily.txt && | |
490 | test_subcommand git prune-packed --quiet <incremental-daily.txt && | |
491 | test_subcommand git multi-pack-index write --no-progress \ | |
492 | <incremental-daily.txt && | |
acc1c4d5 DS |
493 | test_subcommand ! git pack-refs --all --prune \ |
494 | <incremental-daily.txt && | |
495 | ||
496 | test_subcommand git commit-graph write --split --reachable \ | |
497 | --no-progress <incremental-weekly.txt && | |
498 | test_subcommand git prune-packed --quiet <incremental-weekly.txt && | |
499 | test_subcommand git multi-pack-index write --no-progress \ | |
500 | <incremental-weekly.txt && | |
501 | test_subcommand git pack-refs --all --prune \ | |
502 | <incremental-weekly.txt && | |
a4cb1a23 DS |
503 | |
504 | # Modify defaults | |
505 | git config maintenance.commit-graph.schedule daily && | |
506 | git config maintenance.loose-objects.schedule hourly && | |
507 | git config maintenance.incremental-repack.enabled false && | |
508 | ||
509 | GIT_TRACE2_EVENT="$(pwd)/modified-hourly.txt" \ | |
510 | git maintenance run --schedule=hourly --quiet && | |
511 | GIT_TRACE2_EVENT="$(pwd)/modified-daily.txt" \ | |
512 | git maintenance run --schedule=daily --quiet && | |
513 | ||
514 | test_subcommand ! git commit-graph write --split --reachable \ | |
515 | --no-progress <modified-hourly.txt && | |
516 | test_subcommand git prune-packed --quiet <modified-hourly.txt && | |
517 | test_subcommand ! git multi-pack-index write --no-progress \ | |
518 | <modified-hourly.txt && | |
519 | ||
520 | test_subcommand git commit-graph write --split --reachable \ | |
521 | --no-progress <modified-daily.txt && | |
522 | test_subcommand git prune-packed --quiet <modified-daily.txt && | |
523 | test_subcommand ! git multi-pack-index write --no-progress \ | |
524 | <modified-daily.txt | |
525 | ' | |
526 | ||
0c18b700 DS |
527 | test_expect_success 'register and unregister' ' |
528 | test_when_finished git config --global --unset-all maintenance.repo && | |
1ebe6b02 DS |
529 | |
530 | test_must_fail git maintenance unregister 2>err && | |
531 | grep "is not registered" err && | |
532 | git maintenance unregister --force && | |
533 | ||
0c18b700 DS |
534 | git config --global --add maintenance.repo /existing1 && |
535 | git config --global --add maintenance.repo /existing2 && | |
536 | git config --global --get-all maintenance.repo >before && | |
61f7a383 | 537 | |
0c18b700 | 538 | git maintenance register && |
61f7a383 DS |
539 | test_cmp_config false maintenance.auto && |
540 | git config --global --get-all maintenance.repo >between && | |
541 | cp before expect && | |
542 | pwd >>expect && | |
543 | test_cmp expect between && | |
544 | ||
0c18b700 DS |
545 | git maintenance unregister && |
546 | git config --global --get-all maintenance.repo >actual && | |
1ebe6b02 DS |
547 | test_cmp before actual && |
548 | ||
1f80129d RP |
549 | git config --file ./other --add maintenance.repo /existing1 && |
550 | git config --file ./other --add maintenance.repo /existing2 && | |
551 | git config --file ./other --get-all maintenance.repo >before && | |
552 | ||
553 | git maintenance register --config-file ./other && | |
554 | test_cmp_config false maintenance.auto && | |
555 | git config --file ./other --get-all maintenance.repo >between && | |
556 | cp before expect && | |
557 | pwd >>expect && | |
558 | test_cmp expect between && | |
559 | ||
560 | git maintenance unregister --config-file ./other && | |
561 | git config --file ./other --get-all maintenance.repo >actual && | |
562 | test_cmp before actual && | |
563 | ||
1ebe6b02 DS |
564 | test_must_fail git maintenance unregister 2>err && |
565 | grep "is not registered" err && | |
1f80129d RP |
566 | git maintenance unregister --force && |
567 | ||
568 | test_must_fail git maintenance unregister --config-file ./other 2>err && | |
569 | grep "is not registered" err && | |
570 | git maintenance unregister --config-file ./other --force | |
0c18b700 DS |
571 | ' |
572 | ||
9e2d884d | 573 | test_expect_success 'register with no value for maintenance.repo' ' |
1c7e239b ÆAB |
574 | cp .git/config .git/config.orig && |
575 | test_when_finished mv .git/config.orig .git/config && | |
576 | ||
577 | cat >>.git/config <<-\EOF && | |
578 | [maintenance] | |
579 | repo | |
580 | EOF | |
9e2d884d ÆAB |
581 | cat >expect <<-\EOF && |
582 | error: missing value for '\''maintenance.repo'\'' | |
583 | EOF | |
584 | git maintenance register 2>actual && | |
585 | test_cmp expect actual && | |
586 | git config maintenance.repo | |
1c7e239b ÆAB |
587 | ' |
588 | ||
9e2d884d | 589 | test_expect_success 'unregister with no value for maintenance.repo' ' |
1c7e239b ÆAB |
590 | cp .git/config .git/config.orig && |
591 | test_when_finished mv .git/config.orig .git/config && | |
592 | ||
593 | cat >>.git/config <<-\EOF && | |
594 | [maintenance] | |
595 | repo | |
596 | EOF | |
9e2d884d ÆAB |
597 | cat >expect <<-\EOF && |
598 | error: missing value for '\''maintenance.repo'\'' | |
599 | EOF | |
600 | test_expect_code 128 git maintenance unregister 2>actual.raw && | |
601 | grep ^error actual.raw >actual && | |
602 | test_cmp expect actual && | |
603 | git config maintenance.repo && | |
604 | ||
605 | git maintenance unregister --force 2>actual.raw && | |
606 | grep ^error actual.raw >actual && | |
607 | test_cmp expect actual && | |
608 | git config maintenance.repo | |
1c7e239b ÆAB |
609 | ' |
610 | ||
483a6d9b DS |
611 | test_expect_success !MINGW 'register and unregister with regex metacharacters' ' |
612 | META="a+b*c" && | |
613 | git init "$META" && | |
614 | git -C "$META" maintenance register && | |
615 | git config --get-all --show-origin maintenance.repo && | |
616 | git config --get-all --global --fixed-value \ | |
617 | maintenance.repo "$(pwd)/$META" && | |
618 | git -C "$META" maintenance unregister && | |
619 | test_must_fail git config --get-all --global --fixed-value \ | |
620 | maintenance.repo "$(pwd)/$META" | |
621 | ' | |
622 | ||
eba1ba9d LH |
623 | test_expect_success 'start --scheduler=<scheduler>' ' |
624 | test_expect_code 129 git maintenance start --scheduler=foo 2>err && | |
6789275d | 625 | test_grep "unrecognized --scheduler argument" err && |
eba1ba9d LH |
626 | |
627 | test_expect_code 129 git maintenance start --no-scheduler 2>err && | |
6789275d | 628 | test_grep "unknown option" err && |
eba1ba9d LH |
629 | |
630 | test_expect_code 128 \ | |
631 | env GIT_TEST_MAINT_SCHEDULER="launchctl:true,schtasks:true" \ | |
632 | git maintenance start --scheduler=crontab 2>err && | |
6789275d | 633 | test_grep "fatal: crontab scheduler is not available" err |
eba1ba9d LH |
634 | ' |
635 | ||
2fec604f | 636 | test_expect_success 'start from empty cron table' ' |
eba1ba9d | 637 | GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt" git maintenance start --scheduler=crontab && |
2fec604f DS |
638 | |
639 | # start registers the repo | |
610a3fc9 | 640 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
2fec604f DS |
641 | |
642 | grep "for-each-repo --config=maintenance.repo maintenance run --schedule=daily" cron.txt && | |
643 | grep "for-each-repo --config=maintenance.repo maintenance run --schedule=hourly" cron.txt && | |
644 | grep "for-each-repo --config=maintenance.repo maintenance run --schedule=weekly" cron.txt | |
645 | ' | |
646 | ||
647 | test_expect_success 'stop from existing schedule' ' | |
31345d55 | 648 | GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt" git maintenance stop && |
2fec604f DS |
649 | |
650 | # stop does not unregister the repo | |
610a3fc9 | 651 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
2fec604f DS |
652 | |
653 | # Operation is idempotent | |
31345d55 | 654 | GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt" git maintenance stop && |
2fec604f DS |
655 | test_must_be_empty cron.txt |
656 | ' | |
657 | ||
658 | test_expect_success 'start preserves existing schedule' ' | |
659 | echo "Important information!" >cron.txt && | |
eba1ba9d | 660 | GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt" git maintenance start --scheduler=crontab && |
2fec604f DS |
661 | grep "Important information!" cron.txt |
662 | ' | |
663 | ||
a52df25a MÅ |
664 | test_expect_success 'magic markers are correct' ' |
665 | grep "GIT MAINTENANCE SCHEDULE" cron.txt >actual && | |
666 | cat >expect <<-\EOF && | |
667 | # BEGIN GIT MAINTENANCE SCHEDULE | |
668 | # END GIT MAINTENANCE SCHEDULE | |
669 | EOF | |
670 | test_cmp actual expect | |
671 | ' | |
672 | ||
66dc0a36 MÅ |
673 | test_expect_success 'stop preserves surrounding schedule' ' |
674 | echo "Crucial information!" >>cron.txt && | |
b2ace187 | 675 | GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt" git maintenance stop && |
66dc0a36 MÅ |
676 | grep "Important information!" cron.txt && |
677 | grep "Crucial information!" cron.txt | |
678 | ' | |
679 | ||
2afe7e35 DS |
680 | test_expect_success 'start and stop macOS maintenance' ' |
681 | # ensure $HOME can be compared against hook arguments on all platforms | |
682 | pfx=$(cd "$HOME" && pwd) && | |
683 | ||
684 | write_script print-args <<-\EOF && | |
685 | echo $* | sed "s:gui/[0-9][0-9]*:gui/[UID]:" >>args | |
686 | EOF | |
687 | ||
688 | rm -f args && | |
eba1ba9d | 689 | GIT_TEST_MAINT_SCHEDULER=launchctl:./print-args git maintenance start --scheduler=launchctl && |
2afe7e35 DS |
690 | |
691 | # start registers the repo | |
b2ace187 | 692 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
2afe7e35 DS |
693 | |
694 | ls "$HOME/Library/LaunchAgents" >actual && | |
695 | cat >expect <<-\EOF && | |
696 | org.git-scm.git.daily.plist | |
697 | org.git-scm.git.hourly.plist | |
698 | org.git-scm.git.weekly.plist | |
699 | EOF | |
700 | test_cmp expect actual && | |
701 | ||
702 | rm -f expect && | |
703 | for frequency in hourly daily weekly | |
704 | do | |
705 | PLIST="$pfx/Library/LaunchAgents/org.git-scm.git.$frequency.plist" && | |
706 | test_xmllint "$PLIST" && | |
707 | grep schedule=$frequency "$PLIST" && | |
708 | echo "bootout gui/[UID] $PLIST" >>expect && | |
709 | echo "bootstrap gui/[UID] $PLIST" >>expect || return 1 | |
710 | done && | |
711 | test_cmp expect args && | |
712 | ||
713 | rm -f args && | |
714 | GIT_TEST_MAINT_SCHEDULER=launchctl:./print-args git maintenance stop && | |
715 | ||
716 | # stop does not unregister the repo | |
b2ace187 | 717 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
2afe7e35 DS |
718 | |
719 | printf "bootout gui/[UID] $pfx/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ | |
720 | hourly daily weekly >expect && | |
721 | test_cmp expect args && | |
722 | ls "$HOME/Library/LaunchAgents" >actual && | |
723 | test_line_count = 0 actual | |
a16eb6b1 DS |
724 | ' |
725 | ||
726 | test_expect_success 'use launchctl list to prevent extra work' ' | |
727 | # ensure we are registered | |
ed8794ef | 728 | GIT_TEST_MAINT_SCHEDULER=launchctl:./print-args git maintenance start --scheduler=launchctl && |
a16eb6b1 DS |
729 | |
730 | # do it again on a fresh args file | |
731 | rm -f args && | |
ed8794ef | 732 | GIT_TEST_MAINT_SCHEDULER=launchctl:./print-args git maintenance start --scheduler=launchctl && |
a16eb6b1 DS |
733 | |
734 | ls "$HOME/Library/LaunchAgents" >actual && | |
735 | cat >expect <<-\EOF && | |
736 | list org.git-scm.git.hourly | |
737 | list org.git-scm.git.daily | |
738 | list org.git-scm.git.weekly | |
739 | EOF | |
740 | test_cmp expect args | |
2afe7e35 DS |
741 | ' |
742 | ||
3797a0a7 DS |
743 | test_expect_success 'start and stop Windows maintenance' ' |
744 | write_script print-args <<-\EOF && | |
745 | echo $* >>args | |
746 | while test $# -gt 0 | |
747 | do | |
748 | case "$1" in | |
749 | /xml) shift; xmlfile=$1; break ;; | |
750 | *) shift ;; | |
751 | esac | |
752 | done | |
753 | test -z "$xmlfile" || cp "$xmlfile" "$xmlfile.xml" | |
754 | EOF | |
755 | ||
756 | rm -f args && | |
eba1ba9d | 757 | GIT_TEST_MAINT_SCHEDULER="schtasks:./print-args" git maintenance start --scheduler=schtasks && |
3797a0a7 DS |
758 | |
759 | # start registers the repo | |
b2ace187 | 760 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
3797a0a7 DS |
761 | |
762 | for frequency in hourly daily weekly | |
763 | do | |
764 | grep "/create /tn Git Maintenance ($frequency) /f /xml" args && | |
765 | file=$(ls .git/schedule_${frequency}*.xml) && | |
766 | test_xmllint "$file" || return 1 | |
767 | done && | |
768 | ||
769 | rm -f args && | |
770 | GIT_TEST_MAINT_SCHEDULER="schtasks:./print-args" git maintenance stop && | |
771 | ||
772 | # stop does not unregister the repo | |
b2ace187 | 773 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && |
3797a0a7 DS |
774 | |
775 | printf "/delete /tn Git Maintenance (%s) /f\n" \ | |
776 | hourly daily weekly >expect && | |
777 | test_cmp expect args | |
778 | ' | |
779 | ||
b681b191 LH |
780 | test_expect_success 'start and stop Linux/systemd maintenance' ' |
781 | write_script print-args <<-\EOF && | |
782 | printf "%s\n" "$*" >>args | |
783 | EOF | |
784 | ||
785 | XDG_CONFIG_HOME="$PWD" && | |
786 | export XDG_CONFIG_HOME && | |
787 | rm -f args && | |
788 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args" git maintenance start --scheduler=systemd-timer && | |
789 | ||
790 | # start registers the repo | |
791 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && | |
792 | ||
daa78701 DS |
793 | for schedule in hourly daily weekly |
794 | do | |
795 | test_path_is_file "systemd/user/git-maintenance@$schedule.timer" || return 1 | |
796 | done && | |
797 | test_path_is_file "systemd/user/git-maintenance@.service" && | |
798 | ||
799 | test_systemd_analyze_verify "systemd/user/git-maintenance@hourly.service" && | |
800 | test_systemd_analyze_verify "systemd/user/git-maintenance@daily.service" && | |
801 | test_systemd_analyze_verify "systemd/user/git-maintenance@weekly.service" && | |
b681b191 LH |
802 | |
803 | printf -- "--user enable --now git-maintenance@%s.timer\n" hourly daily weekly >expect && | |
804 | test_cmp expect args && | |
805 | ||
806 | rm -f args && | |
807 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args" git maintenance stop && | |
808 | ||
809 | # stop does not unregister the repo | |
810 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && | |
811 | ||
daa78701 DS |
812 | for schedule in hourly daily weekly |
813 | do | |
814 | test_path_is_missing "systemd/user/git-maintenance@$schedule.timer" || return 1 | |
815 | done && | |
b681b191 LH |
816 | test_path_is_missing "systemd/user/git-maintenance@.service" && |
817 | ||
818 | printf -- "--user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect && | |
819 | test_cmp expect args | |
820 | ' | |
821 | ||
eba1ba9d LH |
822 | test_expect_success 'start and stop when several schedulers are available' ' |
823 | write_script print-args <<-\EOF && | |
824 | printf "%s\n" "$*" | sed "s:gui/[0-9][0-9]*:gui/[UID]:; s:\(schtasks /create .* /xml\).*:\1:;" >>args | |
825 | EOF | |
826 | ||
827 | rm -f args && | |
b681b191 LH |
828 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args systemctl,launchctl:./print-args launchctl,schtasks:./print-args schtasks" git maintenance start --scheduler=systemd-timer && |
829 | printf "launchctl bootout gui/[UID] $pfx/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ | |
eba1ba9d | 830 | hourly daily weekly >expect && |
b681b191 LH |
831 | printf "schtasks /delete /tn Git Maintenance (%s) /f\n" \ |
832 | hourly daily weekly >>expect && | |
833 | printf -- "systemctl --user enable --now git-maintenance@%s.timer\n" hourly daily weekly >>expect && | |
834 | test_cmp expect args && | |
835 | ||
836 | rm -f args && | |
837 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args systemctl,launchctl:./print-args launchctl,schtasks:./print-args schtasks" git maintenance start --scheduler=launchctl && | |
838 | printf -- "systemctl --user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect && | |
839 | printf "schtasks /delete /tn Git Maintenance (%s) /f\n" \ | |
840 | hourly daily weekly >>expect && | |
eba1ba9d LH |
841 | for frequency in hourly daily weekly |
842 | do | |
843 | PLIST="$pfx/Library/LaunchAgents/org.git-scm.git.$frequency.plist" && | |
844 | echo "launchctl bootout gui/[UID] $PLIST" >>expect && | |
845 | echo "launchctl bootstrap gui/[UID] $PLIST" >>expect || return 1 | |
846 | done && | |
847 | test_cmp expect args && | |
848 | ||
849 | rm -f args && | |
b681b191 LH |
850 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args systemctl,launchctl:./print-args launchctl,schtasks:./print-args schtasks" git maintenance start --scheduler=schtasks && |
851 | printf -- "systemctl --user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect && | |
eba1ba9d | 852 | printf "launchctl bootout gui/[UID] $pfx/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ |
b681b191 | 853 | hourly daily weekly >>expect && |
eba1ba9d LH |
854 | printf "schtasks /create /tn Git Maintenance (%s) /f /xml\n" \ |
855 | hourly daily weekly >>expect && | |
856 | test_cmp expect args && | |
857 | ||
858 | rm -f args && | |
b681b191 LH |
859 | GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args systemctl,launchctl:./print-args launchctl,schtasks:./print-args schtasks" git maintenance stop && |
860 | printf -- "systemctl --user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect && | |
eba1ba9d | 861 | printf "launchctl bootout gui/[UID] $pfx/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ |
b681b191 | 862 | hourly daily weekly >>expect && |
eba1ba9d LH |
863 | printf "schtasks /delete /tn Git Maintenance (%s) /f\n" \ |
864 | hourly daily weekly >>expect && | |
865 | test_cmp expect args | |
866 | ' | |
867 | ||
61f7a383 DS |
868 | test_expect_success 'register preserves existing strategy' ' |
869 | git config maintenance.strategy none && | |
870 | git maintenance register && | |
871 | test_config maintenance.strategy none && | |
872 | git config --unset maintenance.strategy && | |
873 | git maintenance register && | |
874 | test_config maintenance.strategy incremental | |
875 | ' | |
876 | ||
0a1f2d05 | 877 | test_expect_success 'fails when running outside of a repository' ' |
e72f7def RS |
878 | nongit test_must_fail git maintenance run && |
879 | nongit test_must_fail git maintenance stop && | |
880 | nongit test_must_fail git maintenance start && | |
881 | nongit test_must_fail git maintenance register && | |
882 | nongit test_must_fail git maintenance unregister | |
883 | ' | |
884 | ||
26c79743 ES |
885 | test_expect_success 'register and unregister bare repo' ' |
886 | test_when_finished "git config --global --unset-all maintenance.repo || :" && | |
887 | test_might_fail git config --global --unset-all maintenance.repo && | |
888 | git init --bare barerepo && | |
889 | ( | |
890 | cd barerepo && | |
891 | git maintenance register && | |
892 | git config --get --global --fixed-value maintenance.repo "$(pwd)" && | |
893 | git maintenance unregister && | |
894 | test_must_fail git config --global --get-all maintenance.repo | |
895 | ) | |
896 | ' | |
897 | ||
69ecfcac DS |
898 | test_expect_success 'failed schedule prevents config change' ' |
899 | git init --bare failcase && | |
900 | ||
901 | for scheduler in crontab launchctl schtasks systemctl | |
902 | do | |
903 | GIT_TEST_MAINT_SCHEDULER="$scheduler:false" && | |
904 | export GIT_TEST_MAINT_SCHEDULER && | |
905 | test_must_fail \ | |
906 | git -C failcase maintenance start && | |
907 | test_must_fail git -C failcase config maintenance.auto || return 1 | |
908 | done | |
909 | ' | |
910 | ||
2057d750 | 911 | test_done |