From: Johan Herland <johan@herland.net>
To: gitster@pobox.com
Cc: Johan Herland <johan@herland.net>,
git@vger.kernel.org, Per Cederqvist <cederp@opera.com>
Subject: [PATCHv2 2/5] t3200: Minor fix when preparing for tracking failure
Date: Sun, 8 Sep 2013 22:58:12 +0200 [thread overview]
Message-ID: <1378673895-23127-3-git-send-email-johan@herland.net> (raw)
In-Reply-To: <1378673895-23127-1-git-send-email-johan@herland.net>
We're testing that trying to --track a ref that is not covered by any remote
refspec should fail. For that, we want to have refs/remotes/local/master
present, but we also want the remote.local.fetch refspec to NOT match
refs/remotes/local/master (so that the tracking setup will fail, as intended).
However, when doing "git fetch local" to ensure the existence of
refs/remotes/local/master, we must not already have changed remote.local.fetch
so as to cause refs/remotes/local/master not to be fetched. Therefore, set
remote.local.fetch to refs/heads/*:refs/remotes/local/* BEFORE we fetch, and
then reset it to refs/heads/s:refs/remotes/local/s AFTER we have fetched
(but before we test --track).
Signed-off-by: Johan Herland <johan@herland.net>
---
t/t3200-branch.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 44ec6a4..8f6ab8e 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -319,8 +319,9 @@ test_expect_success 'test tracking setup (non-wildcard, matching)' '
test_expect_success 'tracking setup fails on non-matching refspec' '
git config remote.local.url . &&
- git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
+ git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
(git show-ref -q refs/remotes/local/master || git fetch local) &&
+ git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
test_must_fail git branch --track my5 local/master &&
test_must_fail git config branch.my5.remote &&
test_must_fail git config branch.my5.merge
--
1.8.3.GIT
next prev parent reply other threads:[~2013-09-08 20:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 10:40 [PATCH 0/5] branch: Fix --track on a remote-tracking non-branch Johan Herland
2013-09-06 10:40 ` [PATCH 1/5] t2024: Fix inconsequential typos Johan Herland
2013-09-06 17:32 ` Junio C Hamano
2013-09-06 20:53 ` Johan Herland
2013-09-06 10:40 ` [PATCH 2/5] t3200: Minor fix when preparing for tracking failure Johan Herland
2013-09-06 10:40 ` [PATCH 3/5] Refer to branch.<name>.remote/merge when documenting --track Johan Herland
2013-09-06 10:40 ` [PATCH 4/5] t3200: Add test demonstrating minor regression in 41c21f2 Johan Herland
2013-09-06 10:40 ` [PATCH 5/5] branch.c: Relax unnecessary requirement on upstream's remote ref name Johan Herland
2013-09-06 17:29 ` [PATCH 0/5] branch: Fix --track on a remote-tracking non-branch Junio C Hamano
2013-09-08 20:58 ` [PATCHv2 " Johan Herland
2013-09-08 20:58 ` [PATCHv2 1/5] t2024: Fix &&-chaining and a couple of typos Johan Herland
2013-09-08 20:58 ` Johan Herland [this message]
2013-09-08 20:58 ` [PATCHv2 3/5] Refer to branch.<name>.remote/merge when documenting --track Johan Herland
2013-09-08 20:58 ` [PATCHv2 4/5] t3200: Add test demonstrating minor regression in 41c21f2 Johan Herland
2013-09-08 20:58 ` [PATCHv2 5/5] branch.c: Relax unnecessary requirement on upstream's remote ref name Johan Herland
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=1378673895-23127-3-git-send-email-johan@herland.net \
--to=johan@herland.net \
--cc=cederp@opera.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).