t3200: Minor fix when preparing for tracking failure
authorJohan Herland <johan@herland.net>
Sun, 8 Sep 2013 20:58:12 +0000 (22:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2013 18:02:52 +0000 (11:02 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3200-branch.sh
index 44ec6a45f473ffe47aca6945c0e0aab445728f67..8f6ab8e16054bb629768c70c44045f32f6b7722e 100755 (executable)
@@ -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