summaryrefslogtreecommitdiff
path: root/t/t7060-wtstatus.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-05 07:04:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-07 04:16:01 (GMT)
commit4d4d5726aee31522e90df21ef62ee3377c5d8f8d (patch)
treecc1a50ed2de0a96f98415017b824ab8865a5ec0c /t/t7060-wtstatus.sh
parent50b7e70f338e54f3534ee1b14c3bdb4c80d0dcf7 (diff)
downloadgit-4d4d5726aee31522e90df21ef62ee3377c5d8f8d.zip
git-4d4d5726aee31522e90df21ef62ee3377c5d8f8d.tar.gz
git-4d4d5726aee31522e90df21ef62ee3377c5d8f8d.tar.bz2
status: show worktree status of conflicted paths separately
When a path is unmerged in the index, we used to always say "unmerged" in the "Changed but not updated" section, even when the path was deleted in the work tree. Remove unmerged entries from the "Updated" section, and create a new section "Unmerged paths". Describe how the different stages conflict in more detail in this new section. Note that with the current 3-way merge policy (with or without recursive), certain combinations of index stages should never happen. For example, having only stage #2 means that a path that did not exist in the common ancestor was added by us while the other branch did not do anything to it, which would have autoresolved to take our addition. The code nevertheless prepares for the possibility that future merge policies may leave a path in such a state. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7060-wtstatus.sh')
-rwxr-xr-xt/t7060-wtstatus.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 5ad2cd1..1044aa6 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -28,4 +28,31 @@ test_expect_success 'Report new path with conflict' '
test_cmp expect actual
'
+cat >expect <<EOF
+# On branch side
+# Unmerged paths:
+# (use "git reset HEAD <file>..." to unstage)
+# (use "git add <file>..." to mark resolution)
+#
+# deleted by us: foo
+#
+no changes added to commit (use "git add" and/or "git commit -a")
+EOF
+
+test_expect_success 'M/D conflict does not segfault' '
+ mkdir mdconflict &&
+ (
+ cd mdconflict &&
+ git init &&
+ test_commit initial foo "" &&
+ test_commit modify foo foo &&
+ git checkout -b side HEAD^ &&
+ git rm foo &&
+ git commit -m delete &&
+ test_must_fail git merge master &&
+ test_must_fail git status > ../actual
+ ) &&
+ test_cmp expect actual
+'
+
test_done