builtin/receive-pack: convert portions to struct object_id
commit9c44ea440323e35e4a234d0d27d511e9b4d8dc21
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 26 Mar 2017 16:01:29 +0000 (26 16:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2017 16:59:33 +0000 (28 09:59 -0700)
tree20d8b7b083d963188c2a89b4bd1168157cdb12d3
parent14bb40b3f0c646ca81609be1eb3039ede6ce5cc4
builtin/receive-pack: convert portions to struct object_id

Convert some hardcoded constants into uses of parse_oid_hex.
Additionally, convert all uses of struct command, and miscellaneous
other functions necessary for that.  This work is necessary to be able
to convert sha1_array_append later on.

To avoid needing to specify a constant, reject shallow lines with the
wrong length instead of simply ignoring them.

Note that in queue_command we are guaranteed to have a NUL-terminated
buffer or at least one byte of overflow that we can safely read, so the
linelen check can be elided.  We would die in such a case, but not read
invalid memory.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c