From: Michael Haggerty Date: Mon, 24 Mar 2014 17:56:41 GMT Subject: [PATCH v2 08/27] parse_cmd_verify(): Copy old_sha1 instead of evaluating twice Message-ID: <1395683820-17304-9-git-send-email-mhagger@alum.mit.edu> In-Reply-To: <1395683820-17304-1-git-send-email-mhagger@alum.mit.edu> 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 --- builtin/update-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/update-ref.c b/builtin/update-ref.c index 5f197fe..51adf2d 100644 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -249,7 +249,7 @@ static const char *parse_cmd_verify(struct strbuf *input, const char *next) if (!parse_next_arg(input, &next, &value)) { update_store_old_sha1(update, value.buf); - update_store_new_sha1(update, value.buf); + hashcpy(update->new_sha1, update->old_sha1); } else if (!line_termination) die("verify %s missing [] NUL", ref.buf); -- 1.9.0