summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-01-28 12:58:50 -0500
committerJunio C Hamano <gitster@pobox.com>2015-01-28 12:46:07 -0800
commit94ee8e2c98cf4adf0c69b3b8ce5039eea92347b7 (patch)
tree451f0890721c2edd8fcc501723ffedfb4a5022ee
parent249b2004d8c9c58ed1ea1665dfd376af0312ed7e (diff)
downloadgit-jk/remote-curl-an-array-in-struct-cannot-be-null.tar.gz
do not check truth value of flex arraysjk/remote-curl-an-array-in-struct-cannot-be-null
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>
-rw-r--r--remote-curl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 0eb6fc48fb..38cab05ec5 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -514,7 +514,7 @@ static int fetch_git(struct discovery *heads,
argv[argc++] = url;
for (i = 0; i < nr_heads; i++) {
struct ref *ref = to_fetch[i];
- if (!ref->name || !*ref->name)
+ if (!*ref->name)
die("cannot fetch by sha1 over smart http");
argv[argc++] = ref->name;
}