Skip to content

Commit 9a94dba

Browse files
committed
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 <[email protected]>
1 parent 2d1495f commit 9a94dba

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

t/t6200-fmt-merge-msg.sh

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ test_expect_success '[merge] summary/log configuration' '
112112
Common #1
113113
EOF
114114
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 &&
117117
118118
git checkout master &&
119119
test_tick &&
120120
git fetch . left &&
121121
122122
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
123123
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 &&
126126
127127
git checkout master &&
128128
test_tick &&
@@ -134,11 +134,6 @@ test_expect_success '[merge] summary/log configuration' '
134134
test_cmp expected actual2
135135
'
136136

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-
142137
test_expect_success 'setup FETCH_HEAD' '
143138
git checkout master &&
144139
test_tick &&
@@ -248,14 +243,14 @@ test_expect_success 'fmt-merge-msg -m' '
248243
Common #1
249244
EOF
250245
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 &&
253248
git checkout master &&
254249
git fetch "$(pwd)" left &&
255250
git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
256251
git fmt-merge-msg --log -m "Sync with left" \
257252
<.git/FETCH_HEAD >actual.log &&
258-
git config merge.log true &&
253+
test_config merge.log true &&
259254
git fmt-merge-msg -m "Sync with left" \
260255
<.git/FETCH_HEAD >actual.log-config &&
261256
git fmt-merge-msg --no-log -m "Sync with left" \
@@ -290,29 +285,29 @@ test_expect_success 'setup: expected shortlog for two branches' '
290285
'
291286

292287
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 &&
295290
git checkout master &&
296291
test_tick &&
297292
git fetch . left right &&
298293
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
299294
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 &&
302297
git checkout master &&
303298
test_tick &&
304299
git fetch . left right &&
305300
git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
306301
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 &&
309304
git checkout master &&
310305
test_tick &&
311306
git fetch . left right &&
312307
git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
313308
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 &&
316311
git checkout master &&
317312
test_tick &&
318313
git fetch . left right &&
@@ -325,8 +320,8 @@ test_expect_success 'shortlog for two branches' '
325320
'
326321

327322
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 &&
330325
git checkout master &&
331326
test_tick &&
332327
git fetch . left right &&
@@ -335,8 +330,8 @@ test_expect_success 'merge-msg -F' '
335330
'
336331

337332
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 &&
340335
git checkout master &&
341336
test_tick &&
342337
git fetch . left right &&
@@ -350,8 +345,8 @@ test_expect_success 'merge-msg -F in subdirectory' '
350345
'
351346

352347
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 &&
355350
356351
>empty &&
357352
@@ -376,8 +371,8 @@ test_expect_success 'merge-msg tag' '
376371
Common #1
377372
EOF
378373
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 &&
381376
382377
git checkout master &&
383378
test_tick &&
@@ -406,8 +401,8 @@ test_expect_success 'merge-msg two tags' '
406401
Common #1
407402
EOF
408403
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 &&
411406
412407
git checkout master &&
413408
test_tick &&
@@ -436,8 +431,8 @@ test_expect_success 'merge-msg tag and branch' '
436431
Common #1
437432
EOF
438433
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 &&
441436
442437
git checkout master &&
443438
test_tick &&
@@ -464,6 +459,8 @@ test_expect_success 'merge-msg lots of commits' '
464459
echo " ..."
465460
} >expected &&
466461
462+
test_config merge.summary yes &&
463+
467464
git checkout master &&
468465
test_tick &&
469466
git fetch . long &&

0 commit comments

Comments
 (0)