From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: [PATCH v2 2/2] t5520 (pull): use test_config where appropriate
Date: Thu, 28 Mar 2013 18:10:19 +0530 [thread overview]
Message-ID: <1364474419-22796-1-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <7v4nfz1ndo.fsf@alter.siamese.dyndns.org>
Configuration from test_config does not last beyond the end of the
current test assertion, making each test easier to think about in
isolation.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
Removed first hunk, as per Junio's comment.
t/t5520-pull.sh | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index e5adee8..87777ea 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -96,8 +96,7 @@ test_expect_success '--rebase' '
'
test_expect_success 'pull.rebase' '
git reset --hard before-rebase &&
- git config --bool pull.rebase true &&
- test_when_finished "git config --unset pull.rebase" &&
+ test_config pull.rebase true &&
git pull . copy &&
test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
@@ -105,8 +104,7 @@ test_expect_success 'pull.rebase' '
test_expect_success 'branch.to-rebase.rebase' '
git reset --hard before-rebase &&
- git config --bool branch.to-rebase.rebase true &&
- test_when_finished "git config --unset branch.to-rebase.rebase" &&
+ test_config branch.to-rebase.rebase true &&
git pull . copy &&
test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
@@ -114,10 +112,8 @@ test_expect_success 'branch.to-rebase.rebase' '
test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
git reset --hard before-rebase &&
- git config --bool pull.rebase true &&
- test_when_finished "git config --unset pull.rebase" &&
- git config --bool branch.to-rebase.rebase false &&
- test_when_finished "git config --unset branch.to-rebase.rebase" &&
+ test_config pull.rebase true &&
+ test_config branch.to-rebase.rebase false &&
git pull . copy &&
test $(git rev-parse HEAD^) != $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
@@ -171,9 +167,9 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
git update-ref refs/remotes/me/copy copy^ &&
COPY=$(git rev-parse --verify me/copy) &&
git rebase --onto $COPY copy &&
- git config branch.to-rebase.remote me &&
- git config branch.to-rebase.merge refs/heads/copy &&
- git config branch.to-rebase.rebase true &&
+ test_config branch.to-rebase.remote me &&
+ test_config branch.to-rebase.merge refs/heads/copy &&
+ test_config branch.to-rebase.rebase true &&
echo dirty >> file &&
git add file &&
test_must_fail git pull &&
--
1.8.2.141.g07926c6
next prev parent reply other threads:[~2013-03-28 12:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 12:31 [PATCH 0/2] Fix a couple of minor things in pull test Ramkumar Ramachandra
2013-03-22 12:31 ` [PATCH 1/2] t5520 (pull): update test description Ramkumar Ramachandra
2013-03-22 12:31 ` [PATCH 2/2] t5520 (pull): use test_config where appropriate Ramkumar Ramachandra
2013-03-25 15:59 ` Junio C Hamano
2013-03-28 12:40 ` Ramkumar Ramachandra [this message]
2013-03-28 14:50 ` [PATCH v2 " Junio C Hamano
2013-03-28 14:57 ` Ramkumar Ramachandra
2013-03-28 15:17 ` Junio C Hamano
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=1364474419-22796-1-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).