refs: pass NULL to refs_resolve_refdup() if hash is not needed
authorRené Scharfe <l.s.r@web.de>
Sun, 1 Oct 2017 07:28:50 +0000 (09:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Oct 2017 08:26:58 +0000 (17:26 +0900)
This gets us rid of a write-only variable.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
index a3134d23ab11f177d0e5f482848cd9d7086f0b71..a69b70f861d2827a8ea5d20de25071b9a904f579 100644 (file)
@@ -2499,7 +2499,6 @@ static int files_transaction_prepare(struct ref_store *ref_store,
        struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
        char *head_ref = NULL;
        int head_type;
-       struct object_id head_oid;
        struct files_transaction_backend_data *backend_data;
        struct ref_transaction *packed_transaction = NULL;
 
@@ -2556,7 +2555,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
         */
        head_ref = refs_resolve_refdup(ref_store, "HEAD",
                                       RESOLVE_REF_NO_RECURSE,
-                                      head_oid.hash, &head_type);
+                                      NULL, &head_type);
 
        if (head_ref && !(head_type & REF_ISSYMREF)) {
                FREE_AND_NULL(head_ref);