aboutsummaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-28 14:38:27 -0700
committerJunio C Hamano <gitster@pobox.com>2013-03-28 14:38:27 -0700
commit631bc94e67383b66da190550866566f09d32f299 (patch)
treec673750f55ecf7b658fed0a7fd4da116d53b3e56 /t/t7502-commit.sh
parent74bd52681d7c57907bef129cdffb6cd0f2895115 (diff)
parent790f2827378ef99ce1e7dd9b1d3ce42d222d26bd (diff)
downloadgit-631bc94e67383b66da190550866566f09d32f299.tar.gz
git-631bc94e67383b66da190550866566f09d32f299.tar.xz
Merge branch 'yd/use-test-config-unconfig'
Bulk-update of the test suite. * yd/use-test-config-unconfig: t5520: use test_config to set/unset git config variables (leftover bits) t7600: use test_config to set/unset git config variables t7502: remove clear_config t7502: use test_config to set/unset git config variables t9500: use test_config to set/unset git config variables t7508: use test_config to set/unset git config variables t7500: use test_config to set/unset git config variables t5541: use test_config to set/unset git config variables t5520: use test_config to set/unset git config variables t4202: use test_config/test_unconfig to set/unset git config variables t4034: use test_config/test_unconfig to set/unset git config variables t4304: use test_config to set/unset git config variables t3400: use test_config to set/unset git config variables
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh40
1 files changed, 9 insertions, 31 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index f9b44b724..256137f07 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -171,10 +171,9 @@ test_expect_success 'verbose' '
test_expect_success 'verbose respects diff config' '
- git config color.diff always &&
+ test_config color.diff always &&
git status -v >actual &&
- grep "\[1mdiff --git" actual &&
- git config --unset color.diff
+ grep "\[1mdiff --git" actual
'
mesg_with_comment_and_newlines='
@@ -435,16 +434,6 @@ EOF
echo '## Custom template' >template
-clear_config () {
- (
- git config --unset-all "$1"
- case $? in
- 0|5) exit 0 ;;
- *) exit 1 ;;
- esac
- )
-}
-
try_commit () {
git reset --hard &&
echo >>negative &&
@@ -460,67 +449,57 @@ try_commit () {
try_commit_status_combo () {
test_expect_success 'commit' '
- clear_config commit.status &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit' '
- clear_config commit.status &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status' '
- clear_config commit.status &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status' '
- clear_config commit.status &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = yes' '
- clear_config commit.status &&
- git config commit.status yes &&
+ test_config commit.status yes &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = no' '
- clear_config commit.status &&
- git config commit.status no &&
+ test_config commit.status no &&
try_commit "" &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = yes' '
- clear_config commit.status &&
- git config commit.status yes &&
+ test_config commit.status yes &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = yes' '
- clear_config commit.status &&
- git config commit.status yes &&
+ test_config commit.status yes &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = no' '
- clear_config commit.status &&
- git config commit.status no &&
+ test_config commit.status no &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = no' '
- clear_config commit.status &&
- git config commit.status no &&
+ test_config commit.status no &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
@@ -534,8 +513,7 @@ use_template="-t template"
try_commit_status_combo
test_expect_success 'commit --status with custom comment character' '
- test_when_finished "git config --unset core.commentchar" &&
- git config core.commentchar ";" &&
+ test_config core.commentchar ";" &&
try_commit --status &&
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'