summaryrefslogtreecommitdiff
path: root/t/t4200-rerere.sh
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2018-08-05 17:20:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-06 20:22:35 (GMT)
commitbd7dfa543e0263858071b8648a55ef7ccae1085b (patch)
tree48eb73c2e91fdeed8cc586f3fc89c44c41926a80 /t/t4200-rerere.sh
parent4af32207bc106412a456791037fc4a402101fbb4 (diff)
downloadgit-bd7dfa543e0263858071b8648a55ef7ccae1085b.zip
git-bd7dfa543e0263858071b8648a55ef7ccae1085b.tar.gz
git-bd7dfa543e0263858071b8648a55ef7ccae1085b.tar.bz2
rerere: recalculate conflict ID when unresolved conflict is committed
Currently when a user doesn't resolve a conflict, commits the results, and does an operation which creates another conflict, rerere will use the ID of the previously unresolved conflict for the new conflict. This is because the conflict is kept in the MERGE_RR file, which 'rerere' reads every time it is invoked. After the new conflict is solved, rerere will record the resolution with the ID of the old conflict. So in order to replay the conflict, both merges would have to be re-done, instead of just the last one, in order for rerere to be able to automatically resolve the conflict. Instead of that, assign a new conflict ID if there are still conflicts in a file and the file had conflicts at a previous step. This ID matches the conflict we actually resolved at the corresponding step. Note that there are no backwards compatibility worries here, as rerere would have failed to even normalize the conflict before this patch series. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4200-rerere.sh')
-rwxr-xr-xt/t4200-rerere.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index afaf085..819f6dd 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -635,6 +635,13 @@ test_expect_success 'rerere with inner conflict markers' '
git commit -q -m "will solve conflicts later" &&
test_must_fail git merge A &&
cat test >actual &&
+ test_cmp expect actual &&
+
+ git add test &&
+ git commit -m "rerere solved conflict" &&
+ git reset --hard HEAD~ &&
+ test_must_fail git merge A &&
+ cat test >actual &&
test_cmp expect actual
'