Subject: Re: [PATCH v2 3/5] refs: remove the_hash_algo global state

From: Tian Yuchen <[email-masked]>
Date: Sun, 29 Mar 2026 01:03:50 +0800

On 3/28/26 22:09, Shreyansh Paliwal wrote:

> @@ -3153,7 +3150,7 @@ static int migrate_one_ref(const struct reference *ref, void *cb_data)
>   		if (ret < 0)
>   			goto done;
>   
> -		ret = ref_transaction_update(data->transaction, ref->name, NULL, null_oid(the_hash_algo),
> +		ret = ref_transaction_update(data->transaction, ref->name, NULL, null_oid(data->transaction->ref_store->repo->hash_algo),
>   					     symref_target.buf, NULL,
>   					     REF_SKIP_CREATE_REFLOG | REF_NO_DEREF, NULL, data->errbuf);
>   		if (ret < 0)

I have no objection to the logic itself at all, but this line of code 
looks too long. ;)

If I were you, I would write:

	const struct git_hash_algo *algo = 
data->transaction->ref_store->repo->hash_algo;

then:
	null_oid(algo)

Just wanted to remind you to pay attention to readability. There’s no 
need to reply to this email.

Thanks, Yuchen