summaryrefslogtreecommitdiff
path: root/t/t2030-unresolve-info.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-25 21:40:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-12-26 01:10:10 (GMT)
commit8aa38563b22c84b06ea1fff9638cc1f44fda726f (patch)
tree3631ade1815f7d590ba6e4af48559ed2aab5e382 /t/t2030-unresolve-info.sh
parent4421a8235783d0664faa9a1d45be114fd7ad8206 (diff)
downloadgit-8aa38563b22c84b06ea1fff9638cc1f44fda726f.zip
git-8aa38563b22c84b06ea1fff9638cc1f44fda726f.tar.gz
git-8aa38563b22c84b06ea1fff9638cc1f44fda726f.tar.bz2
resolve-undo: teach "update-index --unresolve" to use resolve-undo info
The update-index plumbing command had a hacky --unresolve implementation that was written back in the days when merge was the only way for users to end up with higher stages in the index, and assumed that stage #2 must have come from HEAD, stage #3 from MERGE_HEAD and didn't bother to compute the stage #1 information. There were several issues with this approach: - These days, merge is not the only command, and conflicts coming from commands like cherry-pick, "am -3", etc. cannot be recreated by looking at MERGE_HEAD; - For a conflict that came from a merge that had renames, picking up the same path from MERGE_HEAD and HEAD wouldn't help recreating it, either; - It may have been Ok not to recreate stage #1 back when it was written, because "diff --ours/--theirs" were the only availble ways to review conflicts and they don't need stage #1 information. "diff --cc" that was invented much later is a lot more useful way but it needs stage #1. We can use resolve-undo information recorded in the index extension to solve all of these issues. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2030-unresolve-info.sh')
-rwxr-xr-xt/t2030-unresolve-info.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index ea65f39..28e2eb1 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -108,4 +108,11 @@ test_expect_success 'add records checkout -m undoes' '
grep "^++<<<<<<<" actual
'
+test_expect_success 'unmerge with plumbing' '
+ prime_resolve_undo &&
+ git update-index --unresolve file &&
+ git ls-files -u >actual &&
+ test $(wc -l <actual) = 3
+'
+
test_done