File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,21 @@ test_expect_code () {
149
149
fi
150
150
}
151
151
152
+ # Most tests can use the created repository, but some amy need to create more.
153
+ # Usage: test_create_repo <directory>
154
+ test_create_repo () {
155
+ test " $# " = 1 ||
156
+ error " bug in the test script: not 1 parameter to test-create-repo"
157
+ owd=` pwd`
158
+ repo=" $1 "
159
+ mkdir " $repo "
160
+ cd " $repo " || error " Cannot setup test environment"
161
+ " $GIT_EXEC_PATH /git" init-db --template=$GIT_EXEC_PATH /templates/blt/ 2> /dev/null ||
162
+ error " cannot run git init-db -- have you built things yet?"
163
+ mv .git/hooks .git/hooks-disabled
164
+ cd " $owd "
165
+ }
166
+
152
167
test_done () {
153
168
trap - exit
154
169
case " $test_failure " in
@@ -196,9 +211,5 @@ test -d ../templates/blt || {
196
211
# Test repository
197
212
test=trash
198
213
rm -fr " $test "
199
- mkdir " $test "
200
- cd " $test " || error " Cannot setup test environment"
201
- " $GIT_EXEC_PATH /git" init-db --template=../../templates/blt/ 2> /dev/null ||
202
- error " cannot run git init-db -- have you built things yet?"
203
-
204
- mv .git/hooks .git/hooks-disabled
214
+ test_create_repo $test
215
+ cd " $test "
You can’t perform that action at this time.
0 commit comments