git-diff: Introduce --index and deprecate --cached.
'git diff --cached' still works, but its use is discouraged in the documentation. 'git diff --index' does the same thing and is consistent with how 'git apply --index' works. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
ced7b828fa
commit
4c81c213a4
@ -137,7 +137,7 @@ static int builtin_diff_index(struct rev_info *revs,
|
||||
int cached = 0;
|
||||
while (1 < argc) {
|
||||
const char *arg = argv[1];
|
||||
if (!strcmp(arg, "--cached"))
|
||||
if (!strcmp(arg, "--index") || !strcmp(arg, "--cached"))
|
||||
cached = 1;
|
||||
else
|
||||
usage(builtin_diff_usage);
|
||||
|
Reference in New Issue
Block a user