Thread (89 messages) 89 messages, 3 authors, 2016-06-15

[PATCH 20/86] http: replace prefixcmd() with has_prefix()

STALE3764d

From: Christian Couder <hidden>
Date: 2016-06-15 22:59:12
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Christian Couder <redacted>
---
 http.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/http.c b/http.c
index f3e1439..f2621cd 100644
--- a/http.c
+++ b/http.c
@@ -422,7 +422,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 		credential_from_url(&http_auth, url);
 		if (!ssl_cert_password_required &&
 		    getenv("GIT_SSL_CERT_PASSWORD_PROTECTED") &&
-		    !prefixcmp(url, "https://"))
+		    has_prefix(url, "https://"))
 			ssl_cert_password_required = 1;
 	}
 
@@ -985,7 +985,7 @@ int http_fetch_ref(const char *base, struct ref *ref)
 		strbuf_rtrim(&buffer);
 		if (buffer.len == 40)
 			ret = get_sha1_hex(buffer.buf, ref->old_sha1);
-		else if (!prefixcmp(buffer.buf, "ref: ")) {
+		else if (has_prefix(buffer.buf, "ref: ")) {
 			ref->symref = xstrdup(buffer.buf + 5);
 			ret = 0;
 		}
@@ -1084,8 +1084,8 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
 		case 'P':
 			i++;
 			if (i + 52 <= buf.len &&
-			    !prefixcmp(data + i, " pack-") &&
-			    !prefixcmp(data + i + 46, ".pack\n")) {
+			    has_prefix(data + i, " pack-") &&
+			    has_prefix(data + i + 46, ".pack\n")) {
 				get_sha1_hex(data + i + 6, sha1);
 				fetch_and_setup_pack_index(packs_head, sha1,
 						      base_url);
-- 
1.8.4.1.566.geca833c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help