3 test_description='git reset should work on unborn branch'
6 test_expect_success 'setup' '
11 test_expect_success 'reset' '
15 git ls-files >actual &&
16 test_must_be_empty actual
19 test_expect_success 'reset HEAD' '
22 test_must_fail git reset HEAD
25 test_expect_success 'reset $file' '
31 git ls-files >actual &&
32 test_cmp expect actual
35 test_expect_success PERL 'reset -p' '
39 git reset -p <yes >output &&
41 git ls-files >actual &&
42 test_must_be_empty actual &&
43 test_i18ngrep "Unstage" output
46 test_expect_success 'reset --soft is a no-op' '
52 git ls-files >actual &&
53 test_cmp expect actual
56 test_expect_success 'reset --hard' '
59 test_when_finished "echo a >a" &&
62 git ls-files >actual &&
63 test_must_be_empty actual &&
64 test_path_is_missing a