]> git.ipfire.org Git - thirdparty/git.git/blob - t/perf/p1500-graph-walks.sh
Merge branch 'ws/git-push-doc-grammofix' into maint-2.42
[thirdparty/git.git] / t / perf / p1500-graph-walks.sh
1 #!/bin/sh
2
3 test_description='Commit walk performance tests'
4 . ./perf-lib.sh
5
6 test_perf_large_repo
7
8 test_expect_success 'setup' '
9 git for-each-ref --format="%(refname)" "refs/heads/*" "refs/tags/*" >allrefs &&
10 sort -r allrefs | head -n 50 >refs &&
11 for ref in $(cat refs)
12 do
13 git branch -f ref-$ref $ref &&
14 echo ref-$ref ||
15 return 1
16 done >branches &&
17 for ref in $(cat refs)
18 do
19 git tag -f tag-$ref $ref &&
20 echo tag-$ref ||
21 return 1
22 done >tags &&
23 git commit-graph write --reachable
24 '
25
26 test_perf 'ahead-behind counts: git for-each-ref' '
27 git for-each-ref --format="%(ahead-behind:HEAD)" --stdin <refs
28 '
29
30 test_perf 'ahead-behind counts: git branch' '
31 xargs git branch -l --format="%(ahead-behind:HEAD)" <branches
32 '
33
34 test_perf 'ahead-behind counts: git tag' '
35 xargs git tag -l --format="%(ahead-behind:HEAD)" <tags
36 '
37
38 test_perf 'contains: git for-each-ref --merged' '
39 git for-each-ref --merged=HEAD --stdin <refs
40 '
41
42 test_perf 'contains: git branch --merged' '
43 xargs git branch --merged=HEAD <branches
44 '
45
46 test_perf 'contains: git tag --merged' '
47 xargs git tag --merged=HEAD <tags
48 '
49
50 test_done