Merge branch 'main' of github.com:git/git
[alt-git.git] / t / perf / p1451-fsck-skip-list.sh
blobf767d834f2ea08fe1415a24b4c20de63decf43e2
1 #!/bin/sh
3 test_description='Test fsck skipList performance'
5 . ./perf-lib.sh
7 test_perf_fresh_repo
9 n=1000000
11 test_expect_success "setup $n bad commits" '
12 for i in $(test_seq 1 $n)
14 echo "commit refs/heads/master" &&
15 echo "committer C <c@example.com> 1234567890 +0000" &&
16 echo "data <<EOF" &&
17 echo "$i.Q." &&
18 echo "EOF" || return 1
19 done | q_to_nul | git fast-import
22 skip=0
23 while test $skip -le $n
25 test_expect_success "create skipList for $skip bad commits" '
26 git log --format=%H --max-count=$skip |
27 sort >skiplist
30 test_perf "fsck with $skip skipped bad commits" '
31 git -c fsck.skipList=skiplist fsck
34 case $skip in
35 0) skip=1 ;;
36 *) skip=${skip}0 ;;
37 esac
38 done
40 test_done