From: Josh Steadmon Date: Wed, 03 Aug 2022 22:38:46 GMT Subject: Re: [PATCH v2 04/10] refs: use ref_namespaces for replace refs base Message-ID: In-Reply-To: <8da0b0a31810c8221ad3ab13b8c41cf1a266c2c0.1659122979.git.gitgitgadget@gmail.com> On 2022.07.29 19:29, Derrick Stolee via GitGitGadget wrote: > diff --git a/log-tree.c b/log-tree.c > index d0ac0a6327a..bb80f1a94d2 100644 > --- a/log-tree.c > +++ b/log-tree.c > @@ -141,10 +141,12 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid, > enum object_type objtype; > enum decoration_type deco_type = DECORATION_NONE; > struct decoration_filter *filter = (struct decoration_filter *)cb_data; > + const char *git_replace_ref_base; > > if (filter && !ref_filter_match(refname, filter)) > return 0; > > + git_replace_ref_base = ref_namespaces[NAMESPACE_REPLACE].ref; Is there a reason not to initialize this as soon as we declare it? > if (starts_with(refname, git_replace_ref_base)) { > struct object_id original_oid; > if (!read_replace_refs)