3 test_description
='read-tree -u --reset'
9 test_expect_success
'setup' '
12 echo content >df/file &&
15 git ls-files >expect &&
24 test_expect_success
'reset should work' '
25 git read-tree -u --reset HEAD^ &&
26 git ls-files >actual &&
27 test_cmp expect actual
30 test_expect_success
'reset should remove remnants from a failed merge' '
31 git read-tree --reset -u HEAD &&
32 git ls-files -s >expect &&
33 sha1=$(git rev-parse :new) &&
35 echo "100644 $sha1 1 old"
36 echo "100644 $sha1 3 old"
37 ) | git update-index --index-info &&
40 git read-tree --reset -u HEAD &&
41 git ls-files -s >actual &&
45 test_expect_success
'Porcelain reset should remove remnants too' '
46 git read-tree --reset -u HEAD &&
47 git ls-files -s >expect &&
48 sha1=$(git rev-parse :new) &&
50 echo "100644 $sha1 1 old"
51 echo "100644 $sha1 3 old"
52 ) | git update-index --index-info &&
56 git ls-files -s >actual &&
60 test_expect_success
'Porcelain checkout -f should remove remnants too' '
61 git read-tree --reset -u HEAD &&
62 git ls-files -s >expect &&
63 sha1=$(git rev-parse :new) &&
65 echo "100644 $sha1 1 old"
66 echo "100644 $sha1 3 old"
67 ) | git update-index --index-info &&
71 git ls-files -s >actual &&
75 test_expect_success
'Porcelain checkout -f HEAD should remove remnants too' '
76 git read-tree --reset -u HEAD &&
77 git ls-files -s >expect &&
78 sha1=$(git rev-parse :new) &&
80 echo "100644 $sha1 1 old"
81 echo "100644 $sha1 3 old"
82 ) | git update-index --index-info &&
85 git checkout -f HEAD &&
86 git ls-files -s >actual &&