Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/perf/p1501-rev-parse-oneline.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / perf / p1501-rev-parse-oneline.sh` 71 lines ยท 1721 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test :/ object name notation' 4 5 . ./perf-lib.sh 6 7 test_perf_fresh_repo 8 9 # 10 # Creates lots of merges to make history traversal costly. In 11 # particular it creates 2^($max_level-1)-1 2-way merges on top of 12 # 2^($max_level-1) root commits. E.g., the commit history looks like 13 # this for a $max_level of 3: 14 # 15 # _1_ 16 # / \ 17 # 2 3 18 # / \ / \ 19 # 4 5 6 7 20 # 21 # The numbers are the fast-import marks, which also are the commit 22 # messages. 1 is the HEAD commit and a merge, 2 and 3 are also merges, 23 # 4-7 are the root commits. 24 # 25 build_history () { 26 local max_level="$1" && 27 local level="${2:-1}" && 28 local mark="${3:-1}" && 29 if test $level -eq $max_level 30 then 31 echo "reset refs/heads/master" && 32 echo "from $ZERO_OID" && 33 echo "commit refs/heads/master" && 34 echo "mark :$mark" && 35 echo "committer C `1234567890` +0000" && 36 echo "data < `1234567890` +0000" && 48 echo "data <commits && 59 sed -n -e "s/ .*$//p" -e "q" expect && 60 sed -n -e "s/^.* //p" -e "q" needle 61 ' 62 63 test_perf "rev-parse :/$(cat needle)" ' 64 git rev-parse :/$(cat needle) >actual 65 ' 66 67 test_expect_success 'verify result' ' 68 test_cmp expect actual 69 ' 70 71 test_done