Thread (6 messages) 6 messages, 2 authors, 2016-06-15
STALE3759d

[PATCH 1/2] diff --cached: do not report i-t-a entries as "new"

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 23:04:06
Subsystem: the rest · Maintainer: Linus Torvalds

Paths marked by "git add -N" are simply a reminder to the user that
these files should be staged. If the user does not stage any of them,
"git commit" will not record them.

Align the behavior of "diff --cached" and "git commit". The most
prominent result of this patch is "git status" no longer reports i-t-a
paths as "Changes to be committed".

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 diff-lib.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/diff-lib.c b/diff-lib.c
index a85c497..db0e6f8 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -400,6 +400,8 @@ static void do_oneway_diff(struct unpack_trees_options *o,
 	 * Something added to the tree?
 	 */
 	if (!tree) {
+		if (idx && (idx->ce_flags & CE_INTENT_TO_ADD))
+			return;
 		show_new_file(revs, idx, cached, match_missing);
 		return;
 	}
-- 
2.3.0.rc1.137.g477eb31
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help