{"thread":{"id":"27466","subject":"[PATCH] remove tests of always-false condition","startedAt":"2011-05-26T13:58:16Z","lastAt":"2011-05-26T18:23:46Z","messageCount":2,"participants":["Jim Meyering","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"168764","messageId":"87zkm95zt3.fsf@rho.meyering.net","threadId":"27466","inReplyTo":null,"subject":"[PATCH] remove tests of always-false condition","fromName":"Jim Meyering","fromEmail":"jim@meyering.net","sentAt":"2011-05-26T13:58:16Z","receivedAt":"2011-05-26T13:58:16Z","isPatch":true,"sender":{"key":"jim@meyering.net","avatar":"https://avatars.githubusercontent.com/u/710630?v=4"},"body":"\n* fsck.c (fsck_error_function): Don't test obj->sha1 == 0.\nIt can never be true, since that sha1 member is an array.\n* transport.c (set_upstreams): Likewise for ref->new_sha1.\n\nSigned-off-by: Jim Meyering <meyering@redhat.com>\n---\nFix some coverity-spotted nits.\nRelative to \"next\".\n\n fsck.c      |    2 +-\n transport.c |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/fsck.c b/fsck.c\nindex 6f266c1..60bd4bb 100644\n--- a/fsck.c\n+++ b/fsck.c\n@@ -349,7 +349,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)\n \tva_list ap;\n \tstruct strbuf sb = STRBUF_INIT;\n\n-\tstrbuf_addf(&sb, \"object %s:\", obj->sha1?sha1_to_hex(obj->sha1):\"(null)\");\n+\tstrbuf_addf(&sb, \"object %s:\", sha1_to_hex(obj->sha1));\n\n \tva_start(ap, fmt);\n \tstrbuf_vaddf(&sb, fmt, ap);\ndiff --git a/transport.c b/transport.c\nindex 1a3998e..c9c8056 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,\n \t\t\tcontinue;\n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n-\t\tif (!ref->new_sha1 || is_null_sha1(ref->new_sha1))\n+\t\tif (is_null_sha1(ref->new_sha1))\n \t\t\tcontinue;\n\n \t\t/* Follow symbolic refs (mainly for HEAD). */\n--\n1.7.5.2.660.g9f46c\n"},{"id":"168809","messageId":"7v39k1xqvh.fsf@alter.siamese.dyndns.org","threadId":"27466","inReplyTo":"87zkm95zt3.fsf@rho.meyering.net","subject":"Re: [PATCH] remove tests of always-false condition","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-26T18:23:46Z","receivedAt":"2011-05-26T18:23:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jim Meyering <jim@meyering.net> writes:\n\n> Relative to \"next\".\n\nI don't appreciate this comment especially for a patch that applies\ncleanly to \"maint\".\n\nBut other than that, fine.  Thanks.\n"}]}