summaryrefslogtreecommitdiff
path: root/walker.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-18 15:56:03 -0400
committerJunio C Hamano <gitster@pobox.com>2014-06-20 10:45:19 -0700
commit82e56767aa9334bb0c4cfe81964a576778b93d6e (patch)
treec9866e8fb4f79c325459ef7757cff38ad56dfb23 /walker.h
parente814c39c2fe7cc915ba70c0aa6f03156a28920fc (diff)
downloadgit-82e56767aa9334bb0c4cfe81964a576778b93d6e.tar.gz
fetch-pack: refactor parsing in get_ack
There are several uses of the magic number "line+45" when parsing ACK lines from the server, and it's rather unclear why 45 is the correct number. We can make this more clear by keeping a running pointer as we parse, using skip_prefix to jump past the first "ACK ", then adding 40 to jump past get_sha1_hex (which is still magical, but hopefully 40 is less magical to readers of git code). Note that this actually puts us at line+44. The original required some character between the sha1 and further ACK flags (it is supposed to be a space, but we never enforced that). We start our search for flags at line+44, which meanas we are slightly more liberal than the old code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'walker.h')
0 files changed, 0 insertions, 0 deletions