Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Symonds <dsymonds@gmail.com>2008-10-29 19:15:36 +0300
committerJunio C Hamano <gitster@pobox.com>2008-11-12 01:55:43 +0300
commit2baf1850ceb01dfbee862e30f2a69cf6064e13eb (patch)
treecae035c295bd03571c99d761538c8b7aba3df13e /builtin-diff.c
parent36bd844658cf244ec2c6756c18673a4b7ed8ec9e (diff)
git-diff: Add --staged as a synonym for --cached.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index 9c8c295732..82d4ddabd8 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -118,7 +118,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, "--cached") || !strcmp(arg, "--staged"))
cached = 1;
else
usage(builtin_diff_usage);
@@ -319,7 +319,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
const char *arg = argv[i];
if (!strcmp(arg, "--"))
break;
- else if (!strcmp(arg, "--cached")) {
+ else if (!strcmp(arg, "--cached") ||
+ !strcmp(arg, "--staged")) {
add_head_to_pending(&rev);
if (!rev.pending.nr)
die("No HEAD commit to compare with (yet)");