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 / p6100-describe.sh

42 lines · 978 bytes Raw Blame History
1#!/bin/sh
2
3test_description='performance of git-describe'
4. ./perf-lib.sh
5
6test_perf_default_repo
7
8# clear out old tags and give us a known state
9test_expect_success 'set up tags' '
10 git for-each-ref --format="delete %(refname)" refs/tags >to-delete &&
11 git update-ref --stdin <to-delete &&
12 new=$(git rev-list -1000 HEAD | tail -n 1) &&
13 git tag -m new new $new &&
14 old=$(git rev-list HEAD | tail -n 1) &&
15 git tag -m old old $old
16'
17
18test_perf 'describe HEAD' '
19 git describe HEAD
20'
21
22test_perf 'describe HEAD with one max candidate' '
23 git describe --candidates=1 HEAD
24'
25
26test_perf 'describe HEAD with one tag' '
27 git describe --match=new HEAD
28'
29
30test_expect_success 'set up many unrelated refs' '
31 ref_count=10000 &&
32 git tag -m tip tip HEAD &&
33 test_seq -f "create refs/heads/describe-perf/%05d HEAD" $ref_count |
34 git update-ref --stdin &&
35 git pack-refs --all
36'
37
38test_perf 'describe exact tag with many unrelated refs' '
39 git describe --exact-match HEAD
40'
41
42test_done