summaryrefslogtreecommitdiff
path: root/gitweb/static/js
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-09-14 19:51:27 -0400
committerJunio C Hamano <gitster@pobox.com>2021-09-14 17:12:05 -0700
commitc7d3aabd2793ab5772627ff6da95f8f7c28258ab (patch)
tree264a7c0d76c8d7fba050e7659e0fc3043d5c7b73 /gitweb/static/js
parente56e53067fc3d31899e837293a5bf72e2d086b4a (diff)
serve: provide "receive" function for object-format capability
We get any "object-format" specified by the client by searching for it in the collected list of capabilities the client sent. We can instead just handle it as soon as they send it. This is slightly more efficient, and gets us one step closer to dropping that collected list. Note that we do still have to do our final hash check after receiving all capabilities (because they might not have sent an object-format line at all, and we still have to check that the default matches our repository algorithm). Since the check_algorithm() function would now be down to a single if() statement, I've just inlined it in its only caller. There should be no change of behavior here, except for two broken-protocol cases: - if the client sends multiple conflicting object-format capabilities (which they should not), we'll now choose the last one rather than the first. We could also detect and complain about the duplicates quite easily now, which we could not before, but I didn't do so here. - if the client sends a bogus "object-format" with no equals sign, we'll now say so, rather than "unknown object format: ''" Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/static/js')
0 files changed, 0 insertions, 0 deletions