]>
Commit | Line | Data |
---|---|---|
16ab794b RS |
1 | #!/bin/sh |
2 | ||
3 | test_description='tests for git branch --track' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success 'setup' ' | |
8 | test_commit one && | |
9 | test_commit two | |
10 | ' | |
11 | ||
12 | test_expect_success 'checkout --track -b creates a new tracking branch' ' | |
13 | git checkout --track -b branch1 master && | |
14 | test $(git rev-parse --abbrev-ref HEAD) = branch1 && | |
15 | test $(git config --get branch.branch1.remote) = . && | |
16 | test $(git config --get branch.branch1.merge) = refs/heads/master | |
17 | ' | |
18 | ||
bb2198fb | 19 | test_expect_success 'checkout --track -b rejects an extra path argument' ' |
16ab794b RS |
20 | test_must_fail git checkout --track -b branch2 master one.t 2>err && |
21 | test_i18ngrep "cannot be used with updating paths" err | |
22 | ' | |
23 | ||
24 | test_done |