]> git.ipfire.org Git - thirdparty/git.git/blob - t/perf/p1400-update-ref.sh
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / t / perf / p1400-update-ref.sh
1 #!/bin/sh
2
3 test_description="Tests performance of update-ref"
4
5 . ./perf-lib.sh
6
7 test_perf_fresh_repo
8
9 test_expect_success "setup" '
10 git init --bare target-repo.git &&
11 test_commit PRE &&
12 test_commit POST &&
13 printf "create refs/heads/%d PRE\n" $(test_seq 1000) >create &&
14 printf "update refs/heads/%d POST PRE\n" $(test_seq 1000) >update &&
15 printf "delete refs/heads/%d POST\n" $(test_seq 1000) >delete &&
16 git update-ref --stdin <create
17 '
18
19 test_perf "update-ref" '
20 for i in $(test_seq 1000)
21 do
22 git update-ref refs/heads/branch PRE &&
23 git update-ref refs/heads/branch POST PRE &&
24 git update-ref -d refs/heads/branch
25 done
26 '
27
28 test_perf "update-ref --stdin" '
29 git update-ref --stdin <update &&
30 git update-ref --stdin <delete &&
31 git update-ref --stdin <create
32 '
33
34 test_perf "nonatomic push" '
35 git push ./target-repo.git $(test_seq 1000) &&
36 git push --delete ./target-repo.git $(test_seq 1000)
37 '
38
39 test_done