From 744c040b19412fa5075810eb1aced105fad96726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 23 Sep 2017 11:45:04 +0200 Subject: refs: pass NULL to resolve_ref_unsafe() if hash is not needed This allows us to get rid of some write-only variables, among them seven SHA1 buffers. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- branch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'branch.c') diff --git a/branch.c b/branch.c index 703ded69c..4377ce2fb 100644 --- a/branch.c +++ b/branch.c @@ -191,9 +191,8 @@ int validate_new_branchname(const char *name, struct strbuf *ref, if (!attr_only) { const char *head; - struct object_id oid; - head = resolve_ref_unsafe("HEAD", 0, oid.hash, NULL); + head = resolve_ref_unsafe("HEAD", 0, NULL, NULL); if (!is_bare_repository() && head && !strcmp(head, ref->buf)) die(_("Cannot force update the current branch.")); } -- cgit v1.2.1