summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-06-29 21:17:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-29 21:17:25 (GMT)
commit1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449 (patch)
treeac8c10bd791aae2587bf595f2b4c1ddbd230263b /builtin/diff.c
parent1033b982914206285fb7ee772cd29f7c60c4f929 (diff)
parentc592fd4c83021b4f098012b3307298fff923c6e7 (diff)
downloadgit-1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449.zip
git-1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449.tar.gz
git-1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449.tar.bz2
Merge branch 'dl/diff-usage-comment-update'
An in-code comment in "git diff" has been updated. * dl/diff-usage-comment-update: builtin/diff: fix botched update of usage comment builtin/diff: update usage comment
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index b3d1734..8c36da0 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -376,16 +376,25 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
/*
* We could get N tree-ish in the rev.pending_objects list.
- * Also there could be M blobs there, and P pathspecs.
+ * Also there could be M blobs there, and P pathspecs. --cached may
+ * also be present.
*
* N=0, M=0:
- * cache vs files (diff-files)
+ * cache vs files (diff-files)
+ *
+ * N=0, M=0, --cached:
+ * HEAD vs cache (diff-index --cached)
+ *
* N=0, M=2:
* compare two random blobs. P must be zero.
+ *
* N=0, M=1, P=1:
- * compare a blob with a working tree file.
+ * compare a blob with a working tree file.
*
* N=1, M=0:
+ * tree vs files (diff-index)
+ *
+ * N=1, M=0, --cached:
* tree vs cache (diff-index --cached)
*
* N=2, M=0: