diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-08 22:06:19 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-08 14:26:28 -0800 |
commit | f47182c852601c045f62bd7f669360a920516311 (patch) | |
tree | 3420752253cf8a865d954b01ffc983051ba50e38 /builtin | |
parent | Git 1.7.9-rc0 (diff) | |
download | tgif-f47182c852601c045f62bd7f669360a920516311.tar.xz |
server_supports(): parse feature list more carefully
We have been carefully choosing feature names used in the protocol
extensions so that the vocabulary does not contain a word that is a
substring of another word, so it is not a real problem, but we have
recently added "quiet" feature word, which would mean we cannot later
add some other word with "quiet" (e.g. "quiet-push"), which is awkward.
Let's make sure that we can eventually be able to do so by teaching the
clients and servers that feature words consist of non whitespace
letters. This parser also allows us to later add features with parameters
e.g. "feature=1.5" (parameter values need to be quoted for whitespaces,
but we will worry about the detauls when we do introduce them).
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/receive-pack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index d2dcb7e4af..d8ddcaa0c9 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -731,9 +731,10 @@ static struct command *read_head_info(void) refname = line + 82; reflen = strlen(refname); if (reflen + 82 < len) { - if (strstr(refname + reflen + 1, "report-status")) + const char *feature_list = refname + reflen + 1; + if (parse_feature_request(feature_list, "report-status")) report_status = 1; - if (strstr(refname + reflen + 1, "side-band-64k")) + if (parse_feature_request(feature_list, "side-band-64k")) use_sideband = LARGE_PACKET_MAX; } cmd = xcalloc(1, sizeof(struct command) + len - 80); |