Re: [PATCH 06/19] refspec: remove global tag refspec structure
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 29, 2024, 17:47 UTC
- Message-ID
- <xmqqa5k8y0fy.fsf@gitster.g>
- In-Reply-To
- <0eaa73c109198b332e348921bc0a0dc49c687f98.1716983704.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 11 quoted lines
> + refspec_item_init(&tag_refspec, TAG_REFSPEC, 0);
> ...
> -static struct refspec_item s_tag_refspec = {
> - .force = 0,
> - .pattern = 1,
> - .matching = 0,
> - .exact_sha1 = 0,
> - .negative = 0,
> - .src = "refs/tags/*",
> - .dst = "refs/tags/*",
> -};Regardless of the constness issue, replacing these hardcoded initializer values that is an accident waiting to happen with a call to refspec_item_init() is very much welcomed.
Unless parse_refspec() is an immensely high cost operation, which it isn't.