diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-06-25 13:22:36 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-06-25 13:22:36 -0700 |
| commit | ac997db0c13d3acde8fcb6c79ff095ba6bd27169 (patch) | |
| tree | 3a1294218762ac16d06596c8ab3ac342103bfd99 /diff-lib.c | |
| parent | Merge branch 'ds/commit-graph-lockfile-fix' (diff) | |
| parent | apply: add --intent-to-add (diff) | |
| download | git-ac997db0c13d3acde8fcb6c79ff095ba6bd27169.tar.gz git-ac997db0c13d3acde8fcb6c79ff095ba6bd27169.zip | |
Merge branch 'nd/diff-apply-ita'
"git diff" compares the index and the working tree. For paths
added with intent-to-add bit, the command shows the full contents
of them as added, but the paths themselves were not marked as new
files. They are now shown as new by default.
"git apply" learned the "--intent-to-add" option so that an
otherwise working-tree-only application of a patch will add new
paths to the index marked with the "intent-to-add" bit.
* nd/diff-apply-ita:
apply: add --intent-to-add
t2203: add a test about "diff HEAD" case
diff: turn --ita-invisible-in-index on by default
diff: ignore --ita-[in]visible-in-index when diffing worktree-to-tree
Diffstat (limited to 'diff-lib.c')
| -rw-r--r-- | diff-lib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c index 104f954a25..a9f38eb5a3 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -389,8 +389,12 @@ static void do_oneway_diff(struct unpack_trees_options *o, struct rev_info *revs = o->unpack_data; int match_missing, cached; - /* i-t-a entries do not actually exist in the index */ - if (revs->diffopt.ita_invisible_in_index && + /* + * i-t-a entries do not actually exist in the index (if we're + * looking at its content) + */ + if (o->index_only && + revs->diffopt.ita_invisible_in_index && idx && ce_intent_to_add(idx)) { idx = NULL; if (!tree) |
