@matheusbsbs / matheus-bagliano / commits / dd9142993c
Fork 0

show-ref: fix --quiet --verify

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 17, 2006 at 18:53 UTC dd9142993c0954e2fd325431235bc7556189a01c
1 file changed +5 -3
builtin-show-ref.c
+5 -3
@@ -218,9 +218,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
218 unsigned char sha1[20];
219
220 while (*pattern) {
221 - if (resolve_ref(*pattern, sha1, 1, NULL))
222 - printf("%s %s\n", sha1_to_hex(sha1),
223 - *pattern);
221 + if (resolve_ref(*pattern, sha1, 1, NULL)) {
222 + if (!quiet)
223 + printf("%s %s\n",
224 + sha1_to_hex(sha1), *pattern);
225 + }
226 else if (!quiet)
227 die("'%s' - not a valid ref", *pattern);
228 else