diff-index: report unmerged new entries
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>
Junio C Hamano committed
Aug 4, 2009 at 16:25 UTC
29796c6ccff3e70622398379fdcdfa3fe43333ac
2 files changed
+33
-2
diff-lib.c
+2
-2
@@ -348,8 +348,8 @@ static void do_oneway_diff(struct unpack_trees_options *o,
348
match_missing = !revs->ignore_merges;
349
350
if (cached && idx && ce_stage(idx)) {
351
- if (tree)
352
- diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode, idx->sha1);
351
+ diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode,
352
+ idx->sha1);
353
return;
354
}
355
t/t7060-wtstatus.sh
new
+31
@@ -0,0 +1,31 @@
1
+#!/bin/sh
2
+
3
+test_description='basic work tree status reporting'
4
+
5
+. ./test-lib.sh
6
+
7
+test_expect_success setup '
8
+ test_commit A &&
9
+ test_commit B oneside added &&
10
+ git checkout A^0 &&
11
+ test_commit C oneside created
12
+'
13
+
14
+test_expect_success 'A/A conflict' '
15
+ git checkout B^0 &&
16
+ test_must_fail git merge C
17
+'
18
+
19
+test_expect_success 'Report path with conflict' '
20
+ git diff --cached --name-status >actual &&
21
+ echo "U oneside" >expect &&
22
+ test_cmp expect actual
23
+'
24
+
25
+test_expect_success 'Report new path with conflict' '
26
+ git diff --cached --name-status HEAD^ >actual &&
27
+ echo "U oneside" >expect &&
28
+ test_cmp expect actual
29
+'
30
+
31
+test_done