Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
connect: use strcmp() for string comparison
author
René Scharfe
<l.s.r@web.de>
Sat, 21 Feb 2015 19:49:58 +0000
(20:49 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 22 Feb 2015 20:01:37 +0000
(12:01 -0800)
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>
connect.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
3c84ac8
)
diff --git
a/connect.c
b/connect.c
index 5047402a1aade7a443f55999550ae4542189ef01..5bff3ed3f2eef1d1caf16e919ffb07fc0461d267 100644
(file)
--- 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;
}