3 test_description
='git reset should work on unborn branch'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'setup' '
13 test_expect_success
'reset' '
17 git ls-files >actual &&
18 test_must_be_empty actual
21 test_expect_success
'reset HEAD' '
24 test_must_fail git reset HEAD
27 test_expect_success
'reset $file' '
33 git ls-files >actual &&
34 test_cmp expect actual
37 test_expect_success
'reset -p' '
41 git reset -p <yes >output &&
43 git ls-files >actual &&
44 test_must_be_empty actual &&
45 test_grep "Unstage" output
48 test_expect_success
'reset --soft is a no-op' '
54 git ls-files >actual &&
55 test_cmp expect actual
58 test_expect_success
'reset --hard' '
61 test_when_finished "echo a >a" &&
64 git ls-files >actual &&
65 test_must_be_empty actual &&
66 test_path_is_missing a