From 4682d8521c3ce9d722bd214fd7d5fc92063fdacb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 27 Jun 2012 20:14:47 -0700 Subject: 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 --- diffcore.h | 1 + 1 file changed, 1 insertion(+) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index b8f1fdecf4..ae43149620 100644 --- a/diffcore.h +++ b/diffcore.h @@ -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 -- cgit v1.2.3