parse_cmd_verify(): copy old_sha1 instead of evaluating <oldvalue> twice

Aside from avoiding a tiny bit of work, this makes it transparently obvious that old_sha1 and new_sha1 are identical. It is arguably a bit silly to have to set new_sha1 in order to verify old_sha1, but that is a problem for another day. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Apr 7, 2014 at 15:47 UTC 2f57736002e6a774ce5ab53a15a631da8299f8b4
1 file changed +1 -1
builtin/update-ref.c
+1 -1
@@ -249,7 +249,7 @@ static const char *parse_cmd_verify(struct strbuf *input, const char *next)
249
250 if (!parse_next_arg(input, &next, &value)) {
251 update_store_old_sha1(update, value.buf);
252 - update_store_new_sha1(update, value.buf);
252 + hashcpy(update->new_sha1, update->old_sha1);
253 } else if (!line_termination)
254 die("verify %s missing [<oldvalue>] NUL", ref.buf);
255