зеркало из https://github.com/microsoft/git.git
diff --cached: give more sensible error message when HEAD is yet to be created.
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>
This commit is contained in:
Родитель
56cf9806a9
Коммит
6c09c45138
|
@ -261,6 +261,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
|
|||
break;
|
||||
else if (!strcmp(arg, "--cached")) {
|
||||
add_head(&rev);
|
||||
if (!rev.pending.nr)
|
||||
die("No HEAD commit to compare with (yet)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче