do not check truth value of flex arrays

There is no point in checking "!ref->name" when ref is a
"struct ref". The name field is a flex-array, and there
always has a non-zero address. This is almost certainly not
hurting anything, but it does cause clang-3.6 to complain.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2015-01-28 12:58:50 -05:00 committed by Junio C Hamano
parent 249b2004d8
commit 94ee8e2c98

View File

@ -514,7 +514,7 @@ static int fetch_git(struct discovery *heads,
argv[argc++] = url; argv[argc++] = url;
for (i = 0; i < nr_heads; i++) { for (i = 0; i < nr_heads; i++) {
struct ref *ref = to_fetch[i]; struct ref *ref = to_fetch[i];
if (!ref->name || !*ref->name) if (!*ref->name)
die("cannot fetch by sha1 over smart http"); die("cannot fetch by sha1 over smart http");
argv[argc++] = ref->name; argv[argc++] = ref->name;
} }