summaryrefslogtreecommitdiff
path: root/builtin/update-ref.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-04-07 13:47:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-04-07 19:09:12 (GMT)
commit2f57736002e6a774ce5ab53a15a631da8299f8b4 (patch)
tree32d540e6eac7a12e291e832ae514bc4686740071 /builtin/update-ref.c
parente23d84350a3f4a3bfb86037eb1e6c4b28240324e (diff)
downloadgit-2f57736002e6a774ce5ab53a15a631da8299f8b4.zip
git-2f57736002e6a774ce5ab53a15a631da8299f8b4.tar.gz
git-2f57736002e6a774ce5ab53a15a631da8299f8b4.tar.bz2
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>
Diffstat (limited to 'builtin/update-ref.c')
-rw-r--r--builtin/update-ref.c2
1 files changed, 1 insertions, 1 deletions
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 [<oldvalue>] NUL", ref.buf);