3 test_description
='test <branch>@{push} syntax'
8 git rev-parse
--symbolic-full-name "$1" >actual
&&
12 test_expect_success
'setup' '
13 git init --bare parent.git &&
14 git init --bare other.git &&
15 git remote add origin parent.git &&
16 git remote add other other.git &&
18 git push origin HEAD &&
19 git branch --set-upstream-to=origin/master master &&
20 git branch --track topic origin/master &&
21 git push origin topic &&
25 test_expect_success
'@{push} with default=nothing' '
26 test_config push.default nothing &&
27 test_must_fail git rev-parse master@{push}
30 test_expect_success
'@{push} with default=simple' '
31 test_config push.default simple &&
32 resolve master@{push} refs/remotes/origin/master
35 test_expect_success
'triangular @{push} fails with default=simple' '
36 test_config push.default simple &&
37 test_must_fail git rev-parse topic@{push}
40 test_expect_success
'@{push} with default=current' '
41 test_config push.default current &&
42 resolve topic@{push} refs/remotes/origin/topic
45 test_expect_success
'@{push} with default=matching' '
46 test_config push.default matching &&
47 resolve topic@{push} refs/remotes/origin/topic
50 test_expect_success
'@{push} with pushremote defined' '
51 test_config push.default current &&
52 test_config branch.topic.pushremote other &&
53 resolve topic@{push} refs/remotes/other/topic
56 test_expect_success
'@{push} with push refspecs' '
57 test_config push.default nothing &&
58 test_config remote.origin.push refs/heads/*:refs/heads/magic/* &&
60 resolve topic@{push} refs/remotes/origin/magic/topic