From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Yann Droneaud <ydroneaud@opteya.com>
Subject: [PATCH 2/3] t6200: use test_config/test_unconfig
Date: Mon, 1 Apr 2013 12:57:18 -0700 [thread overview]
Message-ID: <1364846239-8802-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1364846239-8802-1-git-send-email-gitster@pobox.com>
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>
---
t/t6200-fmt-merge-msg.sh | 61 +++++++++++++++++++++++-------------------------
1 file changed, 29 insertions(+), 32 deletions(-)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 992c2a0..f84bb0c 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -112,8 +112,8 @@ test_expect_success '[merge] summary/log configuration' '
Common #1
EOF
- git config merge.log true &&
- test_might_fail git config --unset-all merge.summary &&
+ test_config merge.log true &&
+ test_unconfig merge.summary &&
git checkout master &&
test_tick &&
@@ -121,8 +121,8 @@ test_expect_success '[merge] summary/log configuration' '
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary true &&
+ test_unconfig merge.log &&
+ test_config merge.summary true &&
git checkout master &&
test_tick &&
@@ -134,11 +134,6 @@ test_expect_success '[merge] summary/log configuration' '
test_cmp expected actual2
'
-test_expect_success 'setup: clear [merge] configuration' '
- test_might_fail git config --unset-all merge.log &&
- test_might_fail git config --unset-all merge.summary
-'
-
test_expect_success 'setup FETCH_HEAD' '
git checkout master &&
test_tick &&
@@ -248,14 +243,14 @@ test_expect_success 'fmt-merge-msg -m' '
Common #1
EOF
- test_might_fail git config --unset merge.log &&
- test_might_fail git config --unset merge.summary &&
+ test_unconfig merge.log &&
+ test_unconfig merge.summary &&
git checkout master &&
git fetch "$(pwd)" left &&
git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
git fmt-merge-msg --log -m "Sync with left" \
<.git/FETCH_HEAD >actual.log &&
- git config merge.log true &&
+ test_config merge.log true &&
git fmt-merge-msg -m "Sync with left" \
<.git/FETCH_HEAD >actual.log-config &&
git fmt-merge-msg --no-log -m "Sync with left" \
@@ -290,29 +285,29 @@ test_expect_success 'setup: expected shortlog for two branches' '
'
test_expect_success 'shortlog for two branches' '
- git config merge.log true &&
- test_might_fail git config --unset-all merge.summary &&
+ test_config merge.log true &&
+ test_unconfig merge.summary &&
git checkout master &&
test_tick &&
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary true &&
+ test_unconfig merge.log &&
+ test_config merge.summary true &&
git checkout master &&
test_tick &&
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
- git config merge.log yes &&
- test_might_fail git config --unset-all merge.summary &&
+ test_config merge.log yes &&
+ test_unconfig merge.summary &&
git checkout master &&
test_tick &&
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
git fetch . left right &&
@@ -325,8 +320,8 @@ test_expect_success 'shortlog for two branches' '
'
test_expect_success 'merge-msg -F' '
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
git fetch . left right &&
@@ -335,8 +330,8 @@ test_expect_success 'merge-msg -F' '
'
test_expect_success 'merge-msg -F in subdirectory' '
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
git fetch . left right &&
@@ -350,8 +345,8 @@ test_expect_success 'merge-msg -F in subdirectory' '
'
test_expect_success 'merge-msg with nothing to merge' '
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
>empty &&
@@ -376,8 +371,8 @@ test_expect_success 'merge-msg tag' '
Common #1
EOF
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
@@ -406,8 +401,8 @@ test_expect_success 'merge-msg two tags' '
Common #1
EOF
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
@@ -436,8 +431,8 @@ test_expect_success 'merge-msg tag and branch' '
Common #1
EOF
- test_might_fail git config --unset-all merge.log &&
- git config merge.summary yes &&
+ test_unconfig merge.log &&
+ test_config merge.summary yes &&
git checkout master &&
test_tick &&
@@ -464,6 +459,8 @@ test_expect_success 'merge-msg lots of commits' '
echo " ..."
} >expected &&
+ test_config merge.summary yes &&
+
git checkout master &&
test_tick &&
git fetch . long &&
--
1.8.2-480-g064f421
next prev parent reply other threads:[~2013-04-01 19:57 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 14:55 git merge <tag> behavior Yann Droneaud
2013-03-19 16:19 ` Junio C Hamano
2013-03-19 17:54 ` Re* " Junio C Hamano
2013-04-01 19:57 ` [PATCH 0/3] Merging an annotated tag object Junio C Hamano
2013-04-01 19:57 ` [PATCH 1/3] merge: a random object may not necssarily be a commit Junio C Hamano
2013-04-01 22:51 ` Yann Droneaud
2013-04-02 5:30 ` Jeff King
2013-04-02 15:02 ` Junio C Hamano
2013-04-02 15:03 ` Jeff King
2013-04-01 19:57 ` Junio C Hamano [this message]
2013-04-01 19:57 ` [PATCH 3/3] t6200: test message for merging of an annotated tag Junio C Hamano
2013-03-20 17:53 ` [PATCH] Documentation: merging a tag is a special case Yann Droneaud
2013-03-20 18:54 ` Jonathan Nieder
2013-03-20 19:07 ` Junio C Hamano
2013-03-21 19:50 ` Junio C Hamano
2013-03-21 19:56 ` Jonathan Nieder
2013-03-21 20:10 ` Junio C Hamano
2013-03-21 20:39 ` Jonathan Nieder
2013-03-21 21:47 ` Yann Droneaud
2013-03-21 21:57 ` [PATCH v2] " Yann Droneaud
2013-03-21 22:41 ` Jonathan Nieder
2013-03-20 18:04 ` git merge <tag> behavior Yann Droneaud
2013-03-20 18:12 ` Yann Droneaud
2013-03-20 18:46 ` Junio C Hamano
2013-03-21 20:31 ` Max Nanasy
2013-03-22 9:16 ` Yann Droneaud
2013-03-22 10:09 ` [PATCH] t7600: test merge configuration override Yann Droneaud
2013-03-22 14:47 ` Junio C Hamano
2013-03-24 21:05 ` [PATCH 00/15] Use test_config Yann Droneaud
2013-03-24 21:06 ` [PATCH 01/15] t4018: remove test_config implementation Yann Droneaud
2013-03-24 21:06 ` [PATCH 02/15] t7810: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 03/15] t7811: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 04/15] t3400: use test_config to set/unset git config variables Yann Droneaud
2013-03-24 21:06 ` [PATCH 05/15] t4304: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 06/15] t4034: use test_config/test_unconfig " Yann Droneaud
2013-03-24 21:06 ` [PATCH 07/15] t4202: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 08/15] t5520: use test_config " Yann Droneaud
2013-03-24 21:06 ` [PATCH 09/15] t5541: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 10/15] t7500: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 11/15] t7502: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 12/15] t7508: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 13/15] t7600: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 14/15] t9500: " Yann Droneaud
2013-03-24 21:06 ` [PATCH 15/15] t7502: remove clear_config Yann Droneaud
2013-03-27 15:04 ` Junio C Hamano
2013-03-27 15:05 ` [PATCH 00/15] Use test_config Junio C Hamano
2013-03-27 16:19 ` Yann Droneaud
2013-03-22 15:23 ` git merge <tag> behavior Junio C Hamano
2013-03-22 10:57 ` [PATCH] t7600: merge tag shoud create a merge commit y
2013-03-22 14:48 ` Junio C Hamano
2013-03-22 14:56 ` Yann Droneaud
2013-03-22 15:05 ` Jeff King
2013-03-22 10:57 ` y
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364846239-8802-3-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ydroneaud@opteya.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).