remove tests of always-false condition
PATCH 1/1 remove tests of always-false condition
* fsck.c (fsck_error_function): Don't test obj->sha1 == 0. It can never be true, since that sha1 member is an array.
* transport.c (set_upstreams): Likewise for ref->new_sha1.
Signed-off-by Jim Meyering <[email protected]>
---
Fix some coverity-spotted nits.
Relative to "next".
fsck.c | 2 +- transport.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fsck.c +1 -1
@@ -349,7 +349,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)va_list ap;struct strbuf sb =STRBUF_INIT ; -strbuf_addf (&sb,"object %s:" , obj->sha1?sha1_to_hex (obj->sha1):"(null)" ); +strbuf_addf (&sb,"object %s:" ,sha1_to_hex (obj->sha1));va_start (ap, fmt);strbuf_vaddf (&sb, fmt, ap);
transport.c +1 -1
@@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,continue ;if (!ref->peer_ref)continue ; -if (!ref->new_sha1 ||is_null_sha1 (ref->new_sha1)) +if (is_null_sha1 (ref->new_sha1))continue ;/* Follow symbolic refs (mainly for HEAD). */
--
1.7.5.2.660.g9f46c
Quoted 1 line · Jim Meyering
Relative to "next".
I don't appreciate this comment especially for a patch that applies cleanly to "maint".
But other than that, fine. Thanks.