From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Leandro Lucarella <leandro.lucarella@sociomantic.com>
Subject: [PATCH 4/4] t/push-default: test pushdefault with all modes
Date: Sun, 9 Jun 2013 22:43:20 +0530 [thread overview]
Message-ID: <1370798000-2358-5-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1370798000-2358-1-git-send-email-artagnon@gmail.com>
Introduce test_pushdefault_with_mode() to test that remote.pushdefault
works with all the push.default modes correctly. Exercise it with all
four modes to illustrate how triangular workflows work, and to guard
against regressions.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t5528-push-default.sh | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index 9ddd3a9..9762515 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -39,6 +39,19 @@ test_push_failure () {
test_cmp expect actual
}
+# $1 = push.default value
+# $2 = branch.master.merge value (master or foo)
+# $3 = branch to check for actual output (master or foo)
+test_pushdefault_with_mode () {
+test_expect_success "push.default = $1 works with remote.pushdefault" "
+ test_config branch.master.remote parent1 &&
+ test_config branch.master.merge refs/heads/$2 &&
+ test_config remote.pushdefault parent2 &&
+ test_commit commit-for-$1 &&
+ test_push_success $1 $3 repo2
+"
+}
+
test_expect_success '"upstream" pushes to configured upstream' '
git checkout master &&
test_config branch.master.remote parent1 &&
@@ -115,4 +128,9 @@ test_expect_success 'push to existing branch, upstream configured with different
test_cmp expect-other-name actual-other-name
'
+test_pushdefault_with_mode "matching" "foo" "master"
+test_pushdefault_with_mode "upstream" "foo" "foo"
+test_pushdefault_with_mode "simple" "master" "master"
+test_pushdefault_with_mode "current" "foo" "master"
+
test_done
--
1.8.3.247.g485169c
prev parent reply other threads:[~2013-06-09 17:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-09 17:13 [PATCH 0/4] Fix triangular workflows for upstream, simple Ramkumar Ramachandra
2013-06-09 17:13 ` [PATCH 1/4] t/push-default: remove redundant test_config lines Ramkumar Ramachandra
2013-06-09 17:13 ` [PATCH 2/4] push: make upstream, simple work with pushdefault Ramkumar Ramachandra
2013-06-09 22:51 ` Junio C Hamano
2013-06-10 8:43 ` Ramkumar Ramachandra
2013-06-10 9:37 ` Junio C Hamano
2013-06-10 11:48 ` Ramkumar Ramachandra
2013-06-10 15:47 ` Junio C Hamano
2013-06-10 16:07 ` Ramkumar Ramachandra
2013-06-10 19:09 ` Junio C Hamano
2013-06-13 9:10 ` Ramkumar Ramachandra
2013-06-13 16:48 ` Junio C Hamano
2013-06-13 17:39 ` Junio C Hamano
2013-06-13 17:45 ` Ramkumar Ramachandra
2013-06-09 17:13 ` [PATCH 3/4] t/push-default: generalize test_push_{success, commit} Ramkumar Ramachandra
2013-06-09 17:13 ` Ramkumar Ramachandra [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370798000-2358-5-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=leandro.lucarella@sociomantic.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).