File tree Expand file tree Collapse file tree 2 files changed +47
-8
lines changed Expand file tree Collapse file tree 2 files changed +47
-8
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ test_description=' Tests rebase -i performance'
4
+ . ./perf-lib.sh
5
+
6
+ test_perf_default_repo
7
+
8
+ # This commit merges a sufficiently long topic branch for reasonable
9
+ # performance testing
10
+ branch_merge=ba5312da19c6fdb6c6747d479f58932aae6e900c^{commit}
11
+ export branch_merge
12
+
13
+ git rev-parse --verify $branch_merge > /dev/null 2>&1 || {
14
+ skip_all=' skipping because $branch_merge was not found'
15
+ test_done
16
+ }
17
+
18
+ write_script swap-first-two.sh << \EOF
19
+ case "$1 " in
20
+ */COMMIT_EDITMSG)
21
+ mv "$1 " "$1 ".bak &&
22
+ sed -e '1{h;d}' -e 2G <"$1 ".bak >"$1 "
23
+ ;;
24
+ esac
25
+ EOF
26
+
27
+ test_expect_success ' setup' '
28
+ git config core.editor "\"$PWD"/swap-first-two.sh\" &&
29
+ git checkout -f $branch_merge^2
30
+ '
31
+
32
+ test_perf ' rebase -i' '
33
+ git rebase -i $branch_merge^
34
+ '
35
+
36
+ test_done
Original file line number Diff line number Diff line change @@ -80,23 +80,26 @@ test_perf_create_repo_from () {
80
80
error " bug in the test script: not 2 parameters to test-create-repo"
81
81
repo=" $1 "
82
82
source=" $2 "
83
- source_git=$source /$( cd " $source " && git rev-parse --git-dir)
83
+ source_git=" $( git -C " $source " rev-parse --git-dir) "
84
+ objects_dir=" $( git -C " $source " rev-parse --git-path objects) "
84
85
mkdir -p " $repo /.git"
85
86
(
86
- cd " $repo /.git" &&
87
- { cp -Rl " $source_git /objects" . 2> /dev/null ||
88
- cp -R " $source_git /objects" . ; } &&
87
+ { cp -Rl " $objects_dir " " $repo /.git/" 2> /dev/null ||
88
+ cp -R " $objects_dir " " $repo /.git/" ; } &&
89
89
for stuff in " $source_git " /* ; do
90
90
case " $stuff " in
91
- * /objects|* /hooks|* /config)
91
+ * /objects|* /hooks|* /config| * /commondir )
92
92
;;
93
93
* )
94
- cp -R " $stuff " . || exit 1
94
+ cp -R " $stuff " " $repo /.git/ " || exit 1
95
95
;;
96
96
esac
97
97
done &&
98
- cd .. &&
99
- git init -q &&
98
+ cd " $repo " &&
99
+ git init -q && {
100
+ test_have_prereq SYMLINKS ||
101
+ git config core.symlinks false
102
+ } &&
100
103
mv .git/hooks .git/hooks-disabled 2> /dev/null
101
104
) || error " failed to copy repository '$source ' to '$repo '"
102
105
}
You can’t perform that action at this time.
0 commit comments