diff-index.c: "git diff" has no need to read blob from the standard input
Only "diff --no-index -" does. Bolting the logic into the low-level function diff_populate_filespec() was a layering violation from day one. Move populate_from_stdin() function out of the generic diff.c to its only user, diff-index.c. Also make sure "-" from the command line stays a special token "read from the standard input", even if we later decide to sanitize the result from prefix_filename() function in a few obvious ways, e.g. removing unnecessary "./" prefix, duplicated slashes "//" in the middle, etc. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -43,6 +43,7 @@ struct diff_filespec {
|
||||
unsigned should_free : 1; /* data should be free()'ed */
|
||||
unsigned should_munmap : 1; /* data should be munmap()'ed */
|
||||
unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */
|
||||
unsigned is_stdin : 1;
|
||||
#define DIRTY_SUBMODULE_UNTRACKED 1
|
||||
#define DIRTY_SUBMODULE_MODIFIED 2
|
||||
|
||||
|
Reference in New Issue
Block a user