interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / perf / p1400-update-ref.sh

33 lines · 718 bytes Raw Blame History
1#!/bin/sh
2
3test_description="Tests performance of update-ref"
4
5. ./perf-lib.sh
6
7test_perf_fresh_repo
8
9test_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 || return 1
17 done >instructions
18'
19
20test_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 || return 1
26 done
27'
28
29test_perf "update-ref --stdin" '
30 git update-ref --stdin <instructions >/dev/null
31'
32
33test_done