summaryrefslogtreecommitdiff
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-02-20 20:00:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-20 21:42:21 (GMT)
commit8f9e3e498c113e987c2b8662485db5461cad1c36 (patch)
tree5932cc91d04696f1986fe68b2684adc28f3fb4d6 /builtin/upload-archive.c
parent030e9dd64f931c0ccfb6ad4be88775f8272f02eb (diff)
downloadgit-8f9e3e498c113e987c2b8662485db5461cad1c36.zip
git-8f9e3e498c113e987c2b8662485db5461cad1c36.tar.gz
git-8f9e3e498c113e987c2b8662485db5461cad1c36.tar.bz2
send-pack: prefer prefixcmp over memcmp in receive_status
This code predates prefixcmp, so it used memcmp along with static sizes. Replacing these memcmps with prefixcmp makes the code much more readable, and the lack of static sizes will make refactoring it in future patches simpler. Note that we used to be unnecessarily liberal in parsing the "unpack" status line, and would accept "unpack ok\njunk". No version of git has ever produced that, and it violates the BNF in Documentation/technical/pack-protocol.txt. Let's take this opportunity to tighten the check by converting the prefix comparison into a strcmp. While we're in the area, let's also fix a vague error message that does not follow our usual conventions (it writes directly to stderr and does not use the "error:" prefix). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions