{"thread":{"id":"38624","subject":"[PATCH] connect: use strcmp() for string comparison","startedAt":"2015-02-21T19:49:58Z","lastAt":"2015-02-21T19:49:58Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"256474","messageId":"54E8E166.7070500@web.de","threadId":"38624","inReplyTo":null,"subject":"[PATCH] connect: use strcmp() for string comparison","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2015-02-21T19:49:58Z","receivedAt":"2015-02-21T19:49:58Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Get rid of magic string length constants and simply compare the strings\nusing strcmp().  This makes the intent of the code a bit clearer.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n connect.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex 062e133..2a5c400 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -157,8 +157,7 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,\n \t\t\tserver_capabilities = xstrdup(name + name_len + 1);\n \t\t}\n \n-\t\tif (extra_have &&\n-\t\t    name_len == 5 && !memcmp(\".have\", name, 5)) {\n+\t\tif (extra_have && !strcmp(name, \".have\")) {\n \t\t\tsha1_array_append(extra_have, old_sha1);\n \t\t\tcontinue;\n \t\t}\n-- \n2.3.0\n"}]}