37
git checkout second^0 &&
38
test_tick &&
39
test_must_fail git merge third^0 &&
40
- echo merge does not leave anything &&
40
check_resolve_undo empty &&
42
- echo different >fi/le &&
43
- git add fi/le &&
44
- echo resolving records &&
41
+
42
+ # how should the conflict be resolved?
43
+ case "$1" in
44
+ remove)
45
+ rm -f file/le && git rm fi/le
46
+ ;;
47
+ *) # modify
48
+ echo different >fi/le && git add fi/le
49
+ ;;
50
+ esac
51
check_resolve_undo recorded fi/le initial:fi/le second:fi/le third:fi/le
52
}
53
128
test_expect_success 'unmerge with plumbing' '
129
prime_resolve_undo &&
130
git update-index --unresolve fi/le &&
131
+ git ls-files --resolve-undo fi/le >actual &&
132
+ test_must_be_empty actual &&
133
git ls-files -u >actual &&
134
test_line_count = 3 actual
135
'
138
prime_resolve_undo &&
139
git commit -m "record to nuke MERGE_HEAD" &&
140
git update-index --unresolve fi/le &&
141
+ git ls-files --resolve-undo fi/le >actual &&
142
+ test_must_be_empty actual &&
143
+ git ls-files -u >actual &&
144
+ test_line_count = 3 actual
145
+'
146
+
147
+test_expect_success 'unmerge removal' '
148
+ prime_resolve_undo remove &&
149
+ git update-index --unresolve fi/le &&
150
+ git ls-files --resolve-undo fi/le >actual &&
151
+ test_must_be_empty actual &&
152
+ git ls-files -u >actual &&
153
+ test_line_count = 3 actual
154
+'
155
+
156
+test_expect_success 'unmerge removal after committing' '
157
+ prime_resolve_undo remove &&
158
+ git commit -m "record to nuke MERGE_HEAD" &&
159
+ git update-index --unresolve fi/le &&
160
+ git ls-files --resolve-undo fi/le >actual &&
161
+ test_must_be_empty actual &&
162
git ls-files -u >actual &&
163
test_line_count = 3 actual
164
'