summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56cf980)
raw | patch | inline | side by side (parent: 56cf980)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 25 Feb 2007 06:26:33 +0000 (22:26 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 25 Feb 2007 19:09:56 +0000 (11:09 -0800) |
It is not like the user said 'diff --cached HEAD', so complaining about
HEAD not being a valid commit, while technically might be correct, is
not very helpful.
Signed-off-by: Junio C Hamano <junkio@cox.net>
HEAD not being a valid commit, while technically might be correct, is
not very helpful.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-diff.c | patch | blob | history |
diff --git a/builtin-diff.c b/builtin-diff.c
index c387ebb16c6bd353a84abd9454892eeab309ef1e..67f49329bf6bad1a5bf2592b1792b65421278708 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
break;
else if (!strcmp(arg, "--cached")) {
add_head(&rev);
+ if (!rev.pending.nr)
+ die("No HEAD commit to compare with (yet)");
break;
}
}