]> git.ipfire.org Git - thirdparty/git.git/blame - t/perf/p3400-rebase.sh
Merge branch 'gc/branch-recurse-submodules-fix'
[thirdparty/git.git] / t / perf / p3400-rebase.sh
CommitLineData
b3dfeebb
KW
1#!/bin/sh
2
3test_description='Tests rebase performance'
4. ./perf-lib.sh
5
6test_perf_default_repo
7
de950c57 8test_expect_success 'setup rebasing on top of a lot of changes' '
5aa24d71
AG
9 git checkout -f -B base &&
10 git checkout -B to-rebase &&
11 git checkout -B upstream &&
ed5a2457 12 for i in $(test_seq 100)
b3dfeebb
KW
13 do
14 # simulate huge diffs
15 echo change$i >unrelated-file$i &&
ed5a2457 16 test_seq 1000 >>unrelated-file$i &&
b3dfeebb
KW
17 git add unrelated-file$i &&
18 test_tick &&
19 git commit -m commit$i unrelated-file$i &&
20 echo change$i >unrelated-file$i &&
100c2da2 21 test_seq 1000 | sort -nr >>unrelated-file$i &&
b3dfeebb
KW
22 git add unrelated-file$i &&
23 test_tick &&
24 git commit -m commit$i-reverse unrelated-file$i ||
db5875aa 25 return 1
b3dfeebb
KW
26 done &&
27 git checkout to-rebase &&
28 test_commit our-patch interesting-file
29'
30
31test_perf 'rebase on top of a lot of unrelated changes' '
32 git rebase --onto upstream HEAD^ &&
33 git rebase --onto base HEAD^
34'
35
de950c57
CC
36test_expect_success 'setup rebasing many changes without split-index' '
37 git config core.splitIndex false &&
5aa24d71
AG
38 git checkout -B upstream2 to-rebase &&
39 git checkout -B to-rebase2 upstream
de950c57
CC
40'
41
42test_perf 'rebase a lot of unrelated changes without split-index' '
43 git rebase --onto upstream2 base &&
44 git rebase --onto base upstream2
45'
46
47test_expect_success 'setup rebasing many changes with split-index' '
48 git config core.splitIndex true
49'
50
51test_perf 'rebase a lot of unrelated changes with split-index' '
52 git rebase --onto upstream2 base &&
53 git rebase --onto base upstream2
54'
55
b3dfeebb 56test_done