summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 07a4a3b)
raw | patch | inline | side by side (parent: 07a4a3b)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 4 Aug 2009 23:25:40 +0000 (16:25 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Aug 2009 09:21:11 +0000 (02:21 -0700) |
Since an earlier change to diff-index by d1f2d7e (Make run_diff_index()
use unpack_trees(), not read_tree(), 2008-01-19), we stopped reporting an
unmerged path that does not exist in the tree, but we should.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
use unpack_trees(), not read_tree(), 2008-01-19), we stopped reporting an
unmerged path that does not exist in the tree, but we should.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | patch | blob | history | |
t/t7060-wtstatus.sh | [new file with mode: 0755] | patch | blob |
diff --git a/diff-lib.c b/diff-lib.c
index ad2a4cde74e0c2ec6367a7128aa0732f131f6bdf..ad5b6cac7b8b6e832607f0936a417872d9ede858 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
match_missing = !revs->ignore_merges;
if (cached && idx && ce_stage(idx)) {
- if (tree)
- diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode, idx->sha1);
+ diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode,
+ idx->sha1);
return;
}
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
--- /dev/null
+++ b/t/t7060-wtstatus.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+test_description='basic work tree status reporting'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ test_commit A &&
+ test_commit B oneside added &&
+ git checkout A^0 &&
+ test_commit C oneside created
+'
+
+test_expect_success 'A/A conflict' '
+ git checkout B^0 &&
+ test_must_fail git merge C
+'
+
+test_expect_success 'Report path with conflict' '
+ git diff --cached --name-status >actual &&
+ echo "U oneside" >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'Report new path with conflict' '
+ git diff --cached --name-status HEAD^ >actual &&
+ echo "U oneside" >expect &&
+ test_cmp expect actual
+'
+
+test_done