3 test_description
='tests for git branch --track'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10 test_expect_success
'setup' '
15 test_expect_success
'checkout --track -b creates a new tracking branch' '
16 git checkout --track -b branch1 main &&
17 test $(git rev-parse --abbrev-ref HEAD) = branch1 &&
18 test $(git config --get branch.branch1.remote) = . &&
19 test $(git config --get branch.branch1.merge) = refs/heads/main
22 test_expect_success
'checkout --track -b rejects an extra path argument' '
23 test_must_fail git checkout --track -b branch2 main one.t 2>err &&
24 test_i18ngrep "cannot be used with updating paths" err