Skip to content

Commit 81f339d

Browse files
jherlandgitster
authored andcommitted
t3200: Minor fix when preparing for tracking failure
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a517b1 commit 81f339d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t3200-branch.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ test_expect_success 'test tracking setup (non-wildcard, matching)' '
319319

320320
test_expect_success 'tracking setup fails on non-matching refspec' '
321321
git config remote.local.url . &&
322-
git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
322+
git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
323323
(git show-ref -q refs/remotes/local/master || git fetch local) &&
324+
git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
324325
test_must_fail git branch --track my5 local/master &&
325326
test_must_fail git config branch.my5.remote &&
326327
test_must_fail git config branch.my5.merge

0 commit comments

Comments
 (0)