summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4c86f0)
raw | patch | inline | side by side (parent: c4c86f0)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 28 Oct 2005 03:56:41 +0000 (05:56 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 29 Oct 2005 05:57:01 +0000 (22:57 -0700) |
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
connect.c | patch | blob | history | |
upload-pack.c | patch | blob | history |
diff --git a/connect.c b/connect.c
index b8aea351b8042045feb7bae220290df5d81984a7..c2badc71aa2ccf63fa6d9ef02a5ee76feb54e5c9 100644 (file)
--- a/connect.c
+++ b/connect.c
#include <arpa/inet.h>
#include <netdb.h>
-static char *server_capabilities = "";
+static char *server_capabilities = NULL;
/*
* Read all the refs from the other end
int server_supports(const char *feature)
{
- return strstr(feature, server_capabilities) != NULL;
+ return server_capabilities &&
+ strstr(server_capabilities, feature) != NULL;
}
int get_ack(int fd, unsigned char *result_sha1)
diff --git a/upload-pack.c b/upload-pack.c
index 686445ec9b0a685e8325bb4d62abba90a6b3ad07..c5eff21363245e1febe03aa8d4309f8cbb0cd7fa 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
static int send_ref(const char *refname, const unsigned char *sha1)
{
- static char *capabilities = "\0multi_ack";
+ static char *capabilities = "multi_ack";
struct object *o = parse_object(sha1);
- packet_write(1, "%s %s%s\n", sha1_to_hex(sha1), refname, capabilities);
- capabilities = "";
+ if (capabilities)
+ packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname,
+ 0, capabilities);
+ else
+ packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
+ capabilities = NULL;
if (!(o->flags & OUR_REF)) {
o->flags |= OUR_REF;
nr_our_refs++;