Skip to content

Commit 94ee8e2

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 249b200 commit 94ee8e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote-curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static int fetch_git(struct discovery *heads,
514514
argv[argc++] = url;
515515
for (i = 0; i < nr_heads; i++) {
516516
struct ref *ref = to_fetch[i];
517-
if (!ref->name || !*ref->name)
517+
if (!*ref->name)
518518
die("cannot fetch by sha1 over smart http");
519519
argv[argc++] = ref->name;
520520
}

0 commit comments

Comments
 (0)