refs: pass NULL to refs_resolve_refdup() if hash is not needed
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>
René Scharfe committed
Oct 1, 2017 at 09:28 UTC
872ccb2c69ce44abb198efa1013dd4e0887a7495
1 file changed
+1
-2
refs/files-backend.c
+1
-2
@@ -2499,7 +2499,6 @@ static int files_transaction_prepare(struct ref_store *ref_store,
2499
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
2500
char *head_ref = NULL;
2501
int head_type;
2502
- struct object_id head_oid;
2502
struct files_transaction_backend_data *backend_data;
2503
struct ref_transaction *packed_transaction = NULL;
2504
@@ -2556,7 +2555,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
2555
*/
2556
head_ref = refs_resolve_refdup(ref_store, "HEAD",
2557
RESOLVE_REF_NO_RECURSE,
2559
- head_oid.hash, &head_type);
2558
+ NULL, &head_type);
2559
2560
if (head_ref && !(head_type & REF_ISSYMREF)) {
2561
FREE_AND_NULL(head_ref);