summaryrefslogtreecommitdiff
path: root/t/t2030-unresolve-info.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-25 23:51:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-11 02:10:36 (GMT)
commitdea4562bf5d1c27cd6c01b9cb65c3a8b8ee99a69 (patch)
treebdcd9bf016f18206cb361aebb644e6ea9fe9c718 /t/t2030-unresolve-info.sh
parent27d6b08536838fff0e3568a57cc622ca1c39bf01 (diff)
downloadgit-dea4562bf5d1c27cd6c01b9cb65c3a8b8ee99a69.zip
git-dea4562bf5d1c27cd6c01b9cb65c3a8b8ee99a69.tar.gz
git-dea4562bf5d1c27cd6c01b9cb65c3a8b8ee99a69.tar.bz2
rerere forget path: forget recorded resolution
After you find out an earlier resolution you told rerere to use was a mismerge, there is no easy way to clear it. A new subcommand "forget" can be used to tell git to forget a recorded resolution, so that you can redo the merge from scratch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2030-unresolve-info.sh')
-rwxr-xr-xt/t2030-unresolve-info.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 28e2eb1..a38bd6d 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -115,4 +115,29 @@ test_expect_success 'unmerge with plumbing' '
test $(wc -l <actual) = 3
'
+test_expect_success 'rerere and rerere --forget' '
+ mkdir .git/rr-cache &&
+ prime_resolve_undo &&
+ echo record the resolution &&
+ git rerere &&
+ rerere_id=$(cd .git/rr-cache && echo */postimage) &&
+ rerere_id=${rerere_id%/postimage} &&
+ test -f .git/rr-cache/$rerere_id/postimage &&
+ git checkout -m file &&
+ echo resurrect the conflict &&
+ grep "^=======" file &&
+ echo reresolve the conflict &&
+ git rerere &&
+ test "z$(cat file)" = zdifferent &&
+ echo register the resolution again &&
+ git add file &&
+ check_resolve_undo kept file initial:file second:file third:file &&
+ test -z "$(git ls-files -u)" &&
+ git rerere forget file &&
+ ! test -f .git/rr-cache/$rerere_id/postimage &&
+ tr "\0" "\n" <.git/MERGE_RR >actual &&
+ echo "$rerere_id file" >expect &&
+ test_cmp expect actual
+'
+
test_done