diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-06-29 14:17:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-06-29 14:17:27 -0700 |
| commit | 298d704e708773f6ddeb4e680265ab904d710def (patch) | |
| tree | cf63ca6ce2682dfb247dec1ff0f1be06c98ed7ef /builtin/diff-files.c | |
| parent | Merge branch 'rs/commit-reach-leakfix' (diff) | |
| parent | diff-files: treat "i-t-a" files as "not-in-index" (diff) | |
| download | git-298d704e708773f6ddeb4e680265ab904d710def.tar.gz git-298d704e708773f6ddeb4e680265ab904d710def.zip | |
Merge branch 'sk/diff-files-show-i-t-a-as-new'
"git diff-files" has been taught to say paths that are marked as
intent-to-add are new files, not modified from an empty blob.
* sk/diff-files-show-i-t-a-as-new:
diff-files: treat "i-t-a" files as "not-in-index"
Diffstat (limited to 'builtin/diff-files.c')
| -rw-r--r-- | builtin/diff-files.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 86ae474fbf..1e352dd8f7 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -28,6 +28,13 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ repo_init_revisions(the_repository, &rev, prefix); rev.abbrev = 0; + + /* + * Consider "intent-to-add" files as new by default, unless + * explicitly specified in the command line or anywhere else. + */ + rev.diffopt.ita_invisible_in_index = 1; + precompose_argv(argc, argv); argc = setup_revisions(argc, argv, &rev, NULL); |
