t0001: use test_config_global
We hand-set several config options using : git config -f $HOME/.gitconfig ... Instead, we can use "test_config_global". Not only is this more readable, but it cleans up for us so that subsequent tests aren't polluted by our settings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 20, 2014 at 19:18 UTC
2a472410cbb481c56ee207dbda2ee99d158c0f48
1 file changed
+4
-7
t/t0001-init.sh
+4
-7
@@ -211,9 +211,8 @@ test_expect_success 'init with --template (blank)' '
211
test_expect_success 'init with init.templatedir set' '
212
mkdir templatedir-source &&
213
echo Content >templatedir-source/file &&
214
+ test_config_global init.templatedir "${HOME}/templatedir-source" &&
215
(
215
- test_config="${HOME}/.gitconfig" &&
216
- git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
216
mkdir templatedir-set &&
217
cd templatedir-set &&
218
sane_unset GIT_TEMPLATE_DIR &&
@@ -225,10 +224,9 @@ test_expect_success 'init with init.templatedir set' '
224
'
225
226
test_expect_success 'init --bare/--shared overrides system/global config' '
227
+ test_config_global core.bare false &&
228
+ test_config_global core.sharedRepository 0640 &&
229
(
229
- test_config="$HOME"/.gitconfig &&
230
- git config -f "$test_config" core.bare false &&
231
- git config -f "$test_config" core.sharedRepository 0640 &&
230
mkdir init-bare-shared-override &&
231
cd init-bare-shared-override &&
232
git init --bare --shared=0666
@@ -239,9 +237,8 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
237
'
238
239
test_expect_success 'init honors global core.sharedRepository' '
240
+ test_config_global core.sharedRepository 0666 &&
241
(
243
- test_config="$HOME"/.gitconfig &&
244
- git config -f "$test_config" core.sharedRepository 0666 &&
242
mkdir shared-honor-global &&
243
cd shared-honor-global &&
244
git init