summaryrefslogtreecommitdiff
path: root/t/perf/p0009-diff-pathspec.sh
blob: 6079db52c21ad03ec6c7440d2d261e7d5761861c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

test_description='Tests performance of diffing the working tree with a pathspec'

. ./perf-lib.sh

test_perf_fresh_repo

count=10000
if test_have_prereq EXPENSIVE
then
	count=100000
fi

# The entries exist only in the index, which is enough to
# exercise the index scan.
test_expect_success 'setup' '
	blob=$(echo content | git hash-object -w --stdin) &&
	{
		printf "100644 $blob\taaa/file\n" &&
		printf "100644 $blob\tf%s\n" $(test_seq $count)
	} | git update-index --index-info &&
	git commit -q -m initial &&
	mkdir -p aaa &&
	echo content >aaa/file
'

test_perf 'diff pathspec subtree' '
	git diff HEAD -- aaa/file
'

test_done