summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-02-21 19:49:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-22 20:01:37 (GMT)
commit2ae7f90f263760abd242501471f123632395d7b3 (patch)
treeefa9ad869b610e4f45003fccd4f5f836cbb08957 /connect.c
parent3c84ac86fc896c108b789b8eb26b169cc0e8088a (diff)
downloadgit-2ae7f90f263760abd242501471f123632395d7b3.zip
git-2ae7f90f263760abd242501471f123632395d7b3.tar.gz
git-2ae7f90f263760abd242501471f123632395d7b3.tar.bz2
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>
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/connect.c b/connect.c
index 5047402..5bff3ed 100644
--- a/connect.c
+++ b/connect.c
@@ -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;
}