зеркало из https://github.com/microsoft/git.git
git-show-ref --verify: Fail if called without a reference
builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but without a reference. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
75b62b489a
Коммит
8ab40a2005
|
@ -221,9 +221,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verify) {
|
if (verify) {
|
||||||
|
if (!pattern)
|
||||||
|
die("--verify requires a reference");
|
||||||
|
while (*pattern) {
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
|
|
||||||
while (*pattern) {
|
|
||||||
if (!strncmp(*pattern, "refs/", 5) &&
|
if (!strncmp(*pattern, "refs/", 5) &&
|
||||||
resolve_ref(*pattern, sha1, 1, NULL)) {
|
resolve_ref(*pattern, sha1, 1, NULL)) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче