Raw
1 #!/bin/sh
2
3 test_description='Tests performance of diffing the working tree with a pathspec'
4
5 . ./perf-lib.sh
6
7 test_perf_fresh_repo
8
9 count=10000
10 if test_have_prereq EXPENSIVE
11 then
12 count=100000
13 fi
14
15 # The entries exist only in the index, which is enough to
16 # exercise the index scan.
17 test_expect_success 'setup' '
18 blob=$(echo content | git hash-object -w --stdin) &&
19 {
20 printf "100644 $blob\taaa/file\n" &&
21 printf "100644 $blob\tf%s\n" $(test_seq $count)
22 } | git update-index --index-info &&
23 git commit -q -m initial &&
24 mkdir -p aaa &&
25 echo content >aaa/file
26 '
27
28 test_perf 'diff pathspec subtree' '
29 git diff HEAD -- aaa/file
30 '
31
32 test_done