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 / p3904-stash-patch.sh

43 lines · 962 bytes Raw Blame History
1#!/bin/sh
2
3test_description="Performance tests for git stash -p"
4
5. ./perf-lib.sh
6
7test_perf_fresh_repo
8
9test_expect_success "setup" '
10 mkdir files &&
11 test_seq 1 100000 | while read i; do
12 echo "content $i" >files/$i.txt || return 1
13 done &&
14 git add files/ &&
15 git commit -q -m "add tracked files" &&
16 echo modified >files/1.txt
17'
18
19test_perf "stash -p, no fsmonitor" \
20 --setup 'echo modified >files/1.txt' '
21 printf "q\n" | git stash -p >/dev/null 2>&1 || true
22'
23
24if test_have_prereq FSMONITOR_DAEMON
25then
26 test_expect_success "enable builtin fsmonitor" '
27 git config core.fsmonitor true &&
28 git fsmonitor--daemon start &&
29 git update-index --fsmonitor &&
30 git status >/dev/null 2>&1
31 '
32
33 test_perf "stash -p, builtin fsmonitor" \
34 --setup 'echo modified >files/1.txt && git status >/dev/null 2>&1' '
35 printf "q\n" | git stash -p >/dev/null 2>&1 || true
36 '
37
38 test_expect_success "stop builtin fsmonitor" '
39 git fsmonitor--daemon stop
40 '
41fi
42
43test_done