From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 07/14] t/t5516-fetch-push: don't use branches-file
Date: Sat, 22 Jun 2013 13:28:14 +0530 [thread overview]
Message-ID: <1371887901-5659-8-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1371887901-5659-1-git-send-email-artagnon@gmail.com>
Four tests exercising fetch and push functionality unnecessarily depend
on $GIT_DIR/branches files. Modern Git does not encourage the use of
those files, and the parser remote.c:read_branches_file() is only
provided for backward compatibility with older repositories. We already
have tests in t/t5505-remote to verify that the parser works: so,
substitute the $GIT_DIR/branches configuration with an equivalent
gitconfig-style configuration, using the results of those tests.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t5516-fetch-push.sh | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 4691d51..6e9fa84 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -852,9 +852,11 @@ test_expect_success 'fetch with branches' '
mk_empty testrepo &&
git branch second $the_first_commit &&
git checkout second &&
- echo ".." > testrepo/.git/branches/branch1 &&
(
cd testrepo &&
+ test_config remote.branch1.url ".." &&
+ test_config remote.branch1.fetch "refs/heads/master:refs/heads/branch1" &&
+ test_config remote.branch1.push "HEAD:refs/heads/master" &&
git fetch branch1 &&
echo "$the_commit commit refs/heads/branch1" >expect &&
git for-each-ref refs/heads >actual &&
@@ -865,9 +867,11 @@ test_expect_success 'fetch with branches' '
test_expect_success 'fetch with branches containing #' '
mk_empty testrepo &&
- echo "..#second" > testrepo/.git/branches/branch2 &&
(
cd testrepo &&
+ test_config remote.branch2.url ".." &&
+ test_config remote.branch2.fetch "refs/heads/second:refs/heads/branch2" &&
+ test_config remote.branch2.push "HEAD:refs/heads/second" &&
git fetch branch2 &&
echo "$the_first_commit commit refs/heads/branch2" >expect &&
git for-each-ref refs/heads >actual &&
@@ -879,7 +883,9 @@ test_expect_success 'fetch with branches containing #' '
test_expect_success 'push with branches' '
mk_empty testrepo &&
git checkout second &&
- echo "testrepo" > .git/branches/branch1 &&
+ test_config remote.branch1.url testrepo &&
+ test_config remote.branch1.fetch "refs/heads/master:refs/heads/branch1" &&
+ test_config remote.branch1.push "HEAD:refs/heads/master" &&
git push branch1 &&
(
cd testrepo &&
@@ -891,7 +897,9 @@ test_expect_success 'push with branches' '
test_expect_success 'push with branches containing #' '
mk_empty testrepo &&
- echo "testrepo#branch3" > .git/branches/branch2 &&
+ test_config remote.branch2.url testrepo &&
+ test_config remote.branch2.fetch "refs/heads/branch3:refs/heads/branch2" &&
+ test_config remote.branch2.push "HEAD:refs/heads/branch3" &&
git push branch2 &&
(
cd testrepo &&
--
1.8.3.1.498.gacf2885
next prev parent reply other threads:[~2013-06-22 8:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-22 7:58 [PATCH v2 00/14] Classify {branches,remotes}-file as fringe features Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 01/14] t/t5505-remote: modernize style Ramkumar Ramachandra
2013-06-23 7:42 ` Junio C Hamano
2013-06-23 7:50 ` Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 02/14] t/t5505-remote: test push-refspec in branches-file Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 03/14] t/t5505-remote: use test_path_is_missing Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 04/14] t/t5505-remote: remove dependency on $origin_url Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 05/14] remote: remove dead code in read_branches_file() Ramkumar Ramachandra
2013-06-23 7:19 ` Junio C Hamano
2013-06-22 7:58 ` [PATCH v2 06/14] t/t5505-remote: test url-with-# in branches-file Ramkumar Ramachandra
2013-06-22 7:58 ` Ramkumar Ramachandra [this message]
2013-06-22 7:58 ` [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git Ramkumar Ramachandra
2013-06-23 7:22 ` Junio C Hamano
2013-06-23 7:53 ` Ramkumar Ramachandra
2013-06-23 8:04 ` Junio C Hamano
2013-06-22 7:58 ` [PATCH v2 09/14] ls-remote doc: rewrite <repository> paragraph Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 10/14] ls-remote doc: don't encourage use of branches-file Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file Ramkumar Ramachandra
2013-06-23 8:07 ` Junio C Hamano
2013-06-23 8:28 ` Ramkumar Ramachandra
2013-06-23 21:49 ` Junio C Hamano
2013-06-22 7:58 ` [PATCH v2 12/14] t/t5510-fetch: don't use remotes-file Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 13/14] t/t5515-fetch-merge-logic: don't use {branches,remotes}-file Ramkumar Ramachandra
[not found] ` <CA+gHt1B1pKz5iU+9m_gi36u7g91qZqgdkY97WDAWjRGxu-Vjuw@mail.gmail.com>
2013-06-25 10:20 ` Ramkumar Ramachandra
2013-06-22 7:58 ` [PATCH v2 14/14] remote: add comment about read_{branches,remotes}_file Ramkumar Ramachandra
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=1371887901-5659-8-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.
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).