fetch-pack: refactor command and capability write
[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         test_commit PRE &&
11         test_commit POST &&
12         for i in $(test_seq 5000)
13         do
14                 printf "start\ncreate refs/heads/%d PRE\ncommit\n" $i &&
15                 printf "start\nupdate refs/heads/%d POST PRE\ncommit\n" $i &&
16                 printf "start\ndelete refs/heads/%d POST\ncommit\n" $i
17         done >instructions
18 '
19
20 test_perf "update-ref" '
21         for i in $(test_seq 1000)
22         do
23                 git update-ref refs/heads/branch PRE &&
24                 git update-ref refs/heads/branch POST PRE &&
25                 git update-ref -d refs/heads/branch
26         done
27 '
28
29 test_perf "update-ref --stdin" '
30         git update-ref --stdin <instructions >/dev/null
31 '
32
33 test_done