From: Michael Haggerty Date: Mon, 7 Apr 2014 13:48:05 +0000 (+0200) Subject: update-ref.c: extract a new function, parse_next_sha1() X-Git-Tag: v2.1.0-rc0~200^2~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3afcc4637452100c68b469de7757dd2b45b4d29c?hp=3afcc4637452100c68b469de7757dd2b45b4d29c update-ref.c: extract a new function, parse_next_sha1() Replace three functions, update_store_new_sha1(), update_store_old_sha1(), and parse_next_arg(), with a single function, parse_next_sha1(). The new function takes care of a whole argument, including checking whether it is there, converting it to an SHA-1, and emitting errors on EOF or for invalid values. The return value indicates whether the argument was present or absent, which requires a bit of intelligence because absent values are represented differently depending on whether "-z" was used. The new interface means that the calling functions, parse_cmd_*(), don't have to interpret the result differently based on the line_termination mode that is in effect. It also means that parse_cmd_create() can distinguish unambiguously between an empty new value and a zeros new value, which fixes a failure in t1400. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano ---