[PATCH 2/3] connect.c: save symref info from server capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andreas Krey <a.krey@xxxxxx>
---
 connect.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/connect.c b/connect.c
index a0783d4..98c4868 100644
--- a/connect.c
+++ b/connect.c
@@ -72,8 +72,8 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
 	for (;;) {
 		struct ref *ref;
 		unsigned char old_sha1[20];
-		char *name;
-		int len, name_len;
+		char *name, *symref;
+		int len, name_len, symref_len;
 		char *buffer = packet_buffer;
 
 		len = packet_read(in, &src_buf, &src_len,
@@ -94,9 +94,12 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
 		name = buffer + 41;
 
 		name_len = strlen(name);
+		symref = 0;
 		if (len != name_len + 41) {
 			free(server_capabilities);
 			server_capabilities = xstrdup(name + name_len + 1);
+			symref = parse_feature_value(server_capabilities,
+						     "symref", &symref_len);
 		}
 
 		if (extra_have &&
@@ -108,6 +111,10 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
 		if (!check_ref(name, name_len, flags))
 			continue;
 		ref = alloc_ref(buffer + 41);
+		if (symref) {
+			ref->symref = xcalloc(symref_len + 1, 1);
+			strncpy(ref->symref, symref, symref_len);
+		}
 		hashcpy(ref->old_sha1, old_sha1);
 		*list = ref;
 		list = &ref->next;
-- 
1.8.3.1.485.g9704416.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]