Skip to content

Commit 872ccb2

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 744c040 commit 872ccb2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

refs/files-backend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,6 @@ static int files_transaction_prepare(struct ref_store *ref_store,
24992499
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
25002500
char *head_ref = NULL;
25012501
int head_type;
2502-
struct object_id head_oid;
25032502
struct files_transaction_backend_data *backend_data;
25042503
struct ref_transaction *packed_transaction = NULL;
25052504

@@ -2556,7 +2555,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
25562555
*/
25572556
head_ref = refs_resolve_refdup(ref_store, "HEAD",
25582557
RESOLVE_REF_NO_RECURSE,
2559-
head_oid.hash, &head_type);
2558+
NULL, &head_type);
25602559

25612560
if (head_ref && !(head_type & REF_ISSYMREF)) {
25622561
FREE_AND_NULL(head_ref);

0 commit comments

Comments
 (0)