3 test_description
='undoing resolution'
7 check_resolve_undo
() {
12 1|
2|
3) die
"Bug in check-resolve-undo test" ;;
24 sha1
=$
(git rev-parse
--verify "$sha1")
25 printf "100644 %s %s\t%s\n" $sha1 $stage $path
27 done >"$msg.expect" &&
28 git ls-files
--resolve-undo >"$msg.actual" &&
29 test_cmp
"$msg.expect" "$msg.actual"
32 prime_resolve_undo
() {
34 git checkout second^
0 &&
36 test_must_fail git merge third^
0 &&
37 echo merge does not leave anything
&&
38 check_resolve_undo empty
&&
39 echo different
>file &&
41 echo resolving records
&&
42 check_resolve_undo recorded
file initial
:file second
:file third
:file
45 test_expect_success setup
'
46 test_commit initial file first &&
49 test_commit second file second &&
51 test_commit third file third &&
52 git checkout another &&
53 test_commit fourth file fourth &&
57 test_expect_success
'add records switch clears' '
60 git commit -m merged &&
61 echo committing keeps &&
62 check_resolve_undo kept file initial:file second:file third:file &&
63 git checkout second^0 &&
64 echo switching clears &&
65 check_resolve_undo cleared
68 test_expect_success
'rm records reset clears' '
71 git commit -m merged &&
72 echo committing keeps &&
73 check_resolve_undo kept file initial:file second:file third:file &&
75 echo merge clears upfront &&
76 test_must_fail git merge fourth^0 &&
77 check_resolve_undo nuked &&
80 echo resolving records &&
81 check_resolve_undo recorded file initial:file HEAD:file fourth:file &&
84 echo resetting discards &&
85 check_resolve_undo discarded