From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [RFC] add test cases for the --repo option to git push
Date: Tue, 24 Feb 2009 18:40:40 +0100 [thread overview]
Message-ID: <1235497240-20677-1-git-send-email-git@drmicha.warpmail.net> (raw)
In-Reply-To: <76718490902210132w2577c093tf8c2a5e7da8bc0e8@mail.gmail.com>
The --repo=myorigin option is supposed to change the default fallback
remote from "origin" to "myorigin", but not override any direct argument
nor config info of tracking branches. Add tests for this. (currently 2
known breakages)
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Tap tap tap....
This is an R for Comments on the desired behaviour of git push with
respect to --repo. I think the tests below expose that the current
behaviour does not match the current doc. I'm messing around in the code
but can't quite produce a match with the doc yet. Before investing more
time I'm wondering whether the code should adjusted to the doc or vice
versa...
The code change I'm experimenting with right now is making
default_remote_name a global and passing it from push. Does not look
nice (esp. w.r.t. libification) but seems to ibe the minimally invasive
solution.
t/t5516-fetch-push.sh | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 89649e7..8393366 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -419,6 +419,41 @@ test_expect_success 'push with config remote.*.push = HEAD' '
git config --remove-section remote.there
git config --remove-section branch.master
+test_expect_success 'push with --repo=repourl from non-tracking branch' '
+
+ mk_test heads/master &&
+ git push --repo=testrepo &&
+ check_push_result $the_commit heads/master
+'
+
+# set up fake remote config
+test_expect_success 'push with --repo=remoterepo from non-tracking branch' '
+
+ mk_test heads/master &&
+ git config remote.testremote.url testrepo &&
+ git push --repo=testremote &&
+ check_push_result $the_commit heads/master
+'
+
+# set up fake tracking info; testrepo exists, origin does not.
+test_expect_failure 'push with --repo=repo from tracking branch with bad config' '
+
+ mk_test heads/master &&
+ git config branch.master.remote origin &&
+ test_must_fail git push --repo=testrepo
+'
+
+test_expect_failure 'push with --repo=repo from tracking branch with good config' '
+
+ mk_test heads/master &&
+ git config branch.master.remote testrepo &&
+ git push --repo=origin &&
+ check_push_result $the_commit heads/master
+'
+
+# clean up fake remote and tracking info
+git config --unset-all branch.master.remote
+
test_expect_success 'push with dry-run' '
mk_test heads/master &&
--
1.6.2.rc1.30.gd43c
next prev parent reply other threads:[~2009-02-24 17:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 9:16 git push usage Jay Soffian
2009-02-21 9:32 ` Jay Soffian
2009-02-24 17:40 ` Michael J Gruber [this message]
2009-02-25 21:58 ` [RFC] add test cases for the --repo option to git push Junio C Hamano
2009-02-26 9:26 ` Michael J Gruber
2009-02-26 17:09 ` Junio C Hamano
2009-02-26 17:48 ` Michael J Gruber
2009-02-26 22:11 ` Jay Soffian
2009-02-27 10:42 ` Michael J Gruber
2009-02-27 17:34 ` Junio C Hamano
2009-02-27 20:48 ` Jay Soffian
2009-02-27 21:00 ` Linus Torvalds
2009-02-27 21:21 ` Jay Soffian
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=1235497240-20677-1-git-send-email-git@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--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).