t6200: use test_config/test_unconfig
The tests were already well protected from previous ones by running "git config --unset" on variables early they do not want to see, but it is easier to make sure they start from a clean state by using more modern test_config/test_unconfig helper functions. It turns out that the last test depended on the merge.summary configuration previous one leaves behind. Set it explicitly in it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Apr 1, 2013 at 12:33 UTC
9a94dba012b6b892c97d6eaf10d26f256d8dbfde
1 file changed
+29
-32
t/t6200-fmt-merge-msg.sh
+29
-32
@@ -112,8 +112,8 @@ test_expect_success '[merge] summary/log configuration' '
112
Common #1
113
EOF
114
115
- git config merge.log true &&
116
- test_might_fail git config --unset-all merge.summary &&
115
+ test_config merge.log true &&
116
+ test_unconfig merge.summary &&
117
118
git checkout master &&
119
test_tick &&
@@ -121,8 +121,8 @@ test_expect_success '[merge] summary/log configuration' '
121
122
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
123
124
- test_might_fail git config --unset-all merge.log &&
125
- git config merge.summary true &&
124
+ test_unconfig merge.log &&
125
+ test_config merge.summary true &&
126
127
git checkout master &&
128
test_tick &&
@@ -134,11 +134,6 @@ test_expect_success '[merge] summary/log configuration' '
134
test_cmp expected actual2
135
'
136
137
-test_expect_success 'setup: clear [merge] configuration' '
138
- test_might_fail git config --unset-all merge.log &&
139
- test_might_fail git config --unset-all merge.summary
140
-'
141
-
137
test_expect_success 'setup FETCH_HEAD' '
138
git checkout master &&
139
test_tick &&
@@ -248,14 +243,14 @@ test_expect_success 'fmt-merge-msg -m' '
243
Common #1
244
EOF
245
251
- test_might_fail git config --unset merge.log &&
252
- test_might_fail git config --unset merge.summary &&
246
+ test_unconfig merge.log &&
247
+ test_unconfig merge.summary &&
248
git checkout master &&
249
git fetch "$(pwd)" left &&
250
git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
251
git fmt-merge-msg --log -m "Sync with left" \
252
<.git/FETCH_HEAD >actual.log &&
258
- git config merge.log true &&
253
+ test_config merge.log true &&
254
git fmt-merge-msg -m "Sync with left" \
255
<.git/FETCH_HEAD >actual.log-config &&
256
git fmt-merge-msg --no-log -m "Sync with left" \
@@ -290,29 +285,29 @@ test_expect_success 'setup: expected shortlog for two branches' '
285
'
286
287
test_expect_success 'shortlog for two branches' '
293
- git config merge.log true &&
294
- test_might_fail git config --unset-all merge.summary &&
288
+ test_config merge.log true &&
289
+ test_unconfig merge.summary &&
290
git checkout master &&
291
test_tick &&
292
git fetch . left right &&
293
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
294
300
- test_might_fail git config --unset-all merge.log &&
301
- git config merge.summary true &&
295
+ test_unconfig merge.log &&
296
+ test_config merge.summary true &&
297
git checkout master &&
298
test_tick &&
299
git fetch . left right &&
300
git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
301
307
- git config merge.log yes &&
308
- test_might_fail git config --unset-all merge.summary &&
302
+ test_config merge.log yes &&
303
+ test_unconfig merge.summary &&
304
git checkout master &&
305
test_tick &&
306
git fetch . left right &&
307
git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
308
314
- test_might_fail git config --unset-all merge.log &&
315
- git config merge.summary yes &&
309
+ test_unconfig merge.log &&
310
+ test_config merge.summary yes &&
311
git checkout master &&
312
test_tick &&
313
git fetch . left right &&
@@ -325,8 +320,8 @@ test_expect_success 'shortlog for two branches' '
320
'
321
322
test_expect_success 'merge-msg -F' '
328
- test_might_fail git config --unset-all merge.log &&
329
- git config merge.summary yes &&
323
+ test_unconfig merge.log &&
324
+ test_config merge.summary yes &&
325
git checkout master &&
326
test_tick &&
327
git fetch . left right &&
@@ -335,8 +330,8 @@ test_expect_success 'merge-msg -F' '
330
'
331
332
test_expect_success 'merge-msg -F in subdirectory' '
338
- test_might_fail git config --unset-all merge.log &&
339
- git config merge.summary yes &&
333
+ test_unconfig merge.log &&
334
+ test_config merge.summary yes &&
335
git checkout master &&
336
test_tick &&
337
git fetch . left right &&
@@ -350,8 +345,8 @@ test_expect_success 'merge-msg -F in subdirectory' '
345
'
346
347
test_expect_success 'merge-msg with nothing to merge' '
353
- test_might_fail git config --unset-all merge.log &&
354
- git config merge.summary yes &&
348
+ test_unconfig merge.log &&
349
+ test_config merge.summary yes &&
350
351
>empty &&
352
@@ -376,8 +371,8 @@ test_expect_success 'merge-msg tag' '
371
Common #1
372
EOF
373
379
- test_might_fail git config --unset-all merge.log &&
380
- git config merge.summary yes &&
374
+ test_unconfig merge.log &&
375
+ test_config merge.summary yes &&
376
377
git checkout master &&
378
test_tick &&
@@ -406,8 +401,8 @@ test_expect_success 'merge-msg two tags' '
401
Common #1
402
EOF
403
409
- test_might_fail git config --unset-all merge.log &&
410
- git config merge.summary yes &&
404
+ test_unconfig merge.log &&
405
+ test_config merge.summary yes &&
406
407
git checkout master &&
408
test_tick &&
@@ -436,8 +431,8 @@ test_expect_success 'merge-msg tag and branch' '
431
Common #1
432
EOF
433
439
- test_might_fail git config --unset-all merge.log &&
440
- git config merge.summary yes &&
434
+ test_unconfig merge.log &&
435
+ test_config merge.summary yes &&
436
437
git checkout master &&
438
test_tick &&
@@ -464,6 +459,8 @@ test_expect_success 'merge-msg lots of commits' '
459
echo " ..."
460
} >expected &&
461
462
+ test_config merge.summary yes &&
463
+
464
git checkout master &&
465
test_tick &&
466
git fetch . long &&