summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorAndreas Ericsson <ae@op5.se>2006-11-30 11:43:13 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-02 05:57:04 (GMT)
commit4c81c213a479e4aae0653a56ad6e8db5c31f019c (patch)
treef6e293579bb51afb0d7a755878625f6e967b5159 /builtin-diff.c
parentced7b828fadbf3d6de49d75392f1516b4ceb4491 (diff)
downloadgit-4c81c213a479e4aae0653a56ad6e8db5c31f019c.zip
git-4c81c213a479e4aae0653a56ad6e8db5c31f019c.tar.gz
git-4c81c213a479e4aae0653a56ad6e8db5c31f019c.tar.bz2
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>
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index a659020..1c535b1 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -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);