diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-19 13:17:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-19 13:17:49 -0700 |
commit | d0c692263f453f267ddd82b90b1a2fcff9d45f5f (patch) | |
tree | fbf5d1a1a60267b2e8904f180b97e65874fd506a /builtin | |
parent | 1ea28e149403ba92f95205f324cc3119fb92df07 (diff) | |
parent | d95d728aba06a34394d15466045cbdabdada58a2 (diff) | |
download | git-d0c692263f453f267ddd82b90b1a2fcff9d45f5f.tar.gz |
Merge branch 'nd/diff-i-t-a'
After "git add -N", the path appeared in output of "git diff HEAD"
and "git diff --cached HEAD", leading "git status" to classify it
as "Changes to be committed". Such a path, however, is not yet to
be scheduled to be committed. "git diff" showed the change to the
path as modification, not as a "new file", in the header of its
output.
Treat such paths as "yet to be added to the index but Git already
know about them"; "git diff HEAD" and "git diff --cached HEAD"
should not talk about them, and "git diff" should show them as new
files yet to be added to the index.
* nd/diff-i-t-a:
diff-lib.c: adjust position of i-t-a entries in diff
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/add.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/add.c b/builtin/add.c index 3390933d68..ee370b059a 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -63,6 +63,7 @@ static void update_callback(struct diff_queue_struct *q, switch (fix_unmerged_status(p, data)) { default: die(_("unexpected diff status %c"), p->status); + case DIFF_STATUS_ADDED: case DIFF_STATUS_MODIFIED: case DIFF_STATUS_TYPE_CHANGED: if (add_file_to_index(&the_index, path, data->flags)) { |