From: Junio C Hamano Date: Wed, 29 May 2024 17:47:45 GMT Subject: Re: [PATCH 06/19] refspec: remove global tag refspec structure Message-ID: In-Reply-To: <0eaa73c109198b332e348921bc0a0dc49c687f98.1716983704.git.ps@pks.im> Patrick Steinhardt writes: > + 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.