From: Jeff King Date: Wed, 28 Jan 2015 17:58:50 +0000 (-0500) Subject: do not check truth value of flex arrays X-Git-Tag: v2.3.1~7^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/94ee8e2c98cf4adf0c69b3b8ce5039eea92347b7?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 94ee8e2c98cf4adf0c69b3b8ce5039eea92347b7 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; }