1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 10:36:15 +02:00

connect: use strcmp() for string comparison

Get rid of magic string length constants and simply compare the strings
using strcmp().  This makes the intent of the code a bit clearer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2015-02-21 20:49:58 +01:00 committed by Junio C Hamano
parent 3c84ac86fc
commit 2ae7f90f26

View File

@ -161,8 +161,7 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
server_capabilities = xstrdup(name + name_len + 1);
}
if (extra_have &&
name_len == 5 && !memcmp(".have", name, 5)) {
if (extra_have && !strcmp(name, ".have")) {
sha1_array_append(extra_have, old_sha1);
continue;
}