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:
-rw-r--r--builtin/diff.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 42ac803091..bdae4d6a58 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -266,18 +266,30 @@ 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:
* tree vs cache (diff-index --cached)
*
+ * N=1, M=0, --cached:
+ * tree vs files (diff-index)
+ *
* N=2, M=0:
* tree vs tree (diff-tree)
*