1#!/bin/sh
23
test_description='checkout switching away from an invalid branch'
45
. ./test-lib.sh
67
test_expect_success 'setup' '
8echo hello >world &&
9git add world &&
10git commit -m initial
11'
1213
test_expect_success 'checkout should not start branch from a tree' '
14test_must_fail git checkout -b newbranch master^{tree}
15'
1617
test_expect_success 'checkout master from invalid HEAD' '
18echo $_z40 >.git/HEAD &&
19git checkout master --
20'
2122
test_done