* [PATCH] git-show-ref --verify: Fail if called without a reference
@ 2007-02-23 17:12 Dmitry V. Levin
0 siblings, 0 replies; only message in thread
From: Dmitry V. Levin @ 2007-02-23 17:12 UTC (permalink / raw)
To: git
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>
---
builtin-show-ref.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/builtin-show-ref.c b/builtin-show-ref.c
index 853f13f..75211e6 100644
--- a/builtin-show-ref.c
+++ b/builtin-show-ref.c
@@ -221,9 +221,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
}
if (verify) {
- unsigned char sha1[20];
-
+ if (!pattern)
+ die("--verify requires a reference");
while (*pattern) {
+ unsigned char sha1[20];
+
if (!strncmp(*pattern, "refs/", 5) &&
resolve_ref(*pattern, sha1, 1, NULL)) {
if (!quiet)
--
1.5.0.1.GIT
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-23 17:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-23 17:12 [PATCH] git-show-ref --verify: Fail if called without a reference Dmitry V. Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).