t7502: remove clear_config

Using test_config ensure the configuration variable are removed at the end of the test, there's no need to remove variable at the beginning of the test. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Yann Droneaud committed Mar 24, 2013 at 22:06 UTC e023a31de6acdc53c006efe231acc5257740d3b0
1 file changed +6 -26
t/t7502-commit.sh
+6 -26
@@ -418,16 +418,6 @@ EOF
418
419 echo '## Custom template' >template
420
421 -clear_config () {
422 - (
423 - git config --unset-all "$1"
424 - case $? in
425 - 0|5) exit 0 ;;
426 - *) exit 1 ;;
427 - esac
428 - )
429 -}
430 -
421 try_commit () {
422 git reset --hard &&
423 echo >>negative &&
@@ -443,67 +433,57 @@ try_commit () {
433 try_commit_status_combo () {
434
435 test_expect_success 'commit' '
446 - clear_config commit.status &&
436 try_commit "" &&
437 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
438 '
439
440 test_expect_success 'commit' '
452 - clear_config commit.status &&
441 try_commit "" &&
442 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
443 '
444
445 test_expect_success 'commit --status' '
458 - clear_config commit.status &&
446 try_commit --status &&
447 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
448 '
449
450 test_expect_success 'commit --no-status' '
464 - clear_config commit.status &&
451 try_commit --no-status &&
452 test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
453 '
454
455 test_expect_success 'commit with commit.status = yes' '
470 - clear_config commit.status &&
471 - git config commit.status yes &&
456 + test_config commit.status yes &&
457 try_commit "" &&
458 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
459 '
460
461 test_expect_success 'commit with commit.status = no' '
477 - clear_config commit.status &&
478 - git config commit.status no &&
462 + test_config commit.status no &&
463 try_commit "" &&
464 test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
465 '
466
467 test_expect_success 'commit --status with commit.status = yes' '
484 - clear_config commit.status &&
485 - git config commit.status yes &&
468 + test_config commit.status yes &&
469 try_commit --status &&
470 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
471 '
472
473 test_expect_success 'commit --no-status with commit.status = yes' '
491 - clear_config commit.status &&
492 - git config commit.status yes &&
474 + test_config commit.status yes &&
475 try_commit --no-status &&
476 test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
477 '
478
479 test_expect_success 'commit --status with commit.status = no' '
498 - clear_config commit.status &&
499 - git config commit.status no &&
480 + test_config commit.status no &&
481 try_commit --status &&
482 test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
483 '
484
485 test_expect_success 'commit --no-status with commit.status = no' '
505 - clear_config commit.status &&
506 - git config commit.status no &&
486 + test_config commit.status no &&
487 try_commit --no-status &&
488 test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
489 '