From 22179b307894a6e14f33459b43cd485a03ac4add Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Sun, 24 Mar 2013 22:06:09 +0100 Subject: t7500: use test_config to set/unset git config variables Instead of using construct such as: test_when_finished "git config --unset " git config uses test_config The latter takes care of removing at the end of the test. Signed-off-by: Yann Droneaud Signed-off-by: Junio C Hamano --- t/t7500-commit.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 't/t7500-commit.sh') diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index 1c908f4d39..436b7b606e 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -36,8 +36,7 @@ test_expect_success 'nonexistent template file should return error' ' ' test_expect_success 'nonexistent template file in config should return error' ' - git config commit.template "$PWD"/notexist && - test_when_finished "git config --unset commit.template" && + test_config commit.template "$PWD"/notexist && ( GIT_EDITOR="echo hello >\"\$1\"" && export GIT_EDITOR && @@ -93,14 +92,13 @@ test_expect_success '-t option should be short for --template' ' test_expect_success 'config-specified template should commit' ' echo "new template" > "$TEMPLATE" && - git config commit.template "$TEMPLATE" && + test_config commit.template "$TEMPLATE" && echo "more content" >> foo && git add foo && ( test_set_editor "$TEST_DIRECTORY"/t7500/add-content && git commit ) && - git config --unset commit.template && commit_msg_is "new templatecommit message" ' -- cgit v1.2.1 From f66d000b0d7d6d3c858f3aacd9a67d4809ac8011 Mon Sep 17 00:00:00 2001 From: Andrew Pimlott Date: Mon, 1 Jul 2013 09:20:36 -0700 Subject: t7500: fix flipped actual/expect Signed-off-by: Andrew Pimlott Signed-off-by: Junio C Hamano --- t/t7500-commit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/t7500-commit.sh') diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index 436b7b606e..bdc1f29503 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -13,9 +13,9 @@ commit_msg_is () { expect=commit_msg_is.expect actual=commit_msg_is.actual - printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect && - printf "%s" "$1" >$actual && - test_i18ncmp $expect $actual + printf "%s" "$(git log --pretty=format:%s%b -1)" >"$actual" && + printf "%s" "$1" >"$expect" && + test_i18ncmp "$expect" "$actual" } # A sanity check to see if commit is working at all. -- cgit v1.2.1