summaryrefslogtreecommitdiff
path: root/t/t2030-unresolve-info.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-25 19:57:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-12-26 01:10:10 (GMT)
commit4421a8235783d0664faa9a1d45be114fd7ad8206 (patch)
tree90505e56f05e1125140a21516a19667176da6e73 /t/t2030-unresolve-info.sh
parent4a39f79d3482cd844443b4ef9a8ef9b3d72faa5b (diff)
downloadgit-4421a8235783d0664faa9a1d45be114fd7ad8206.zip
git-4421a8235783d0664faa9a1d45be114fd7ad8206.tar.gz
git-4421a8235783d0664faa9a1d45be114fd7ad8206.tar.bz2
resolve-undo: "checkout -m path" uses resolve-undo information
Once you resolved conflicts by "git add path", you cannot recreate the conflicted state with "git checkout -m path", because you lost information from higher stages in the index when you resolved them. Since we record the necessary information in the resolve-undo index extension these days, we can reproduce the unmerged state in the index and check it out. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2030-unresolve-info.sh')
-rwxr-xr-xt/t2030-unresolve-info.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9844802..ea65f39 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -97,4 +97,15 @@ test_expect_success 'plumbing clears' '
check_resolve_undo cleared
'
+test_expect_success 'add records checkout -m undoes' '
+ prime_resolve_undo &&
+ git diff HEAD &&
+ git checkout --conflict=merge file &&
+ echo checkout used the record and removed it &&
+ check_resolve_undo removed &&
+ echo the index and the work tree is unmerged again &&
+ git diff >actual &&
+ grep "^++<<<<<<<" actual
+'
+
test_done