]>
Commit | Line | Data |
---|---|---|
323e00fd AJ |
1 | #!/bin/sh |
2 | ||
3 | test_description='checkout switching away from an invalid branch' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success 'setup' ' | |
8 | echo hello >world && | |
9 | git add world && | |
10 | git commit -m initial | |
11 | ' | |
12 | ||
3442ea4a JH |
13 | test_expect_success 'checkout should not start branch from a tree' ' |
14 | test_must_fail git checkout -b newbranch master^{tree} | |
15 | ' | |
16 | ||
323e00fd | 17 | test_expect_success 'checkout master from invalid HEAD' ' |
3749fde5 | 18 | echo $_z40 >.git/HEAD && |
323e00fd AJ |
19 | git checkout master -- |
20 | ' | |
21 | ||
22 | test_done |