t / perf / p0001-rev-list.shon commit Sync with maint (8b79343)
   1#!/bin/sh
   2
   3test_description="Tests history walking performance"
   4
   5. ./perf-lib.sh
   6
   7test_perf_default_repo
   8
   9test_perf 'rev-list --all' '
  10        git rev-list --all >/dev/null
  11'
  12
  13test_perf 'rev-list --all --objects' '
  14        git rev-list --all --objects >/dev/null
  15'
  16
  17test_perf 'rev-list --parents' '
  18        git rev-list --parents HEAD >/dev/null
  19'
  20
  21test_expect_success 'create dummy file' '
  22        echo unlikely-to-already-be-there >dummy &&
  23        git add dummy &&
  24        git commit -m dummy
  25'
  26
  27test_perf 'rev-list -- dummy' '
  28        git rev-list HEAD -- dummy
  29'
  30
  31test_perf 'rev-list --parents -- dummy' '
  32        git rev-list --parents HEAD -- dummy
  33'
  34
  35test_expect_success 'create new unreferenced commit' '
  36        commit=$(git commit-tree HEAD^{tree} -p HEAD) &&
  37        test_export commit
  38'
  39
  40test_perf 'rev-list $commit --not --all' '
  41        git rev-list $commit --not --all >/dev/null
  42'
  43
  44test_perf 'rev-list --objects $commit --not --all' '
  45        git rev-list --objects $commit --not --all >/dev/null
  46'
  47
  48test_done