Re: [PATCH v2 04/10] refs: use ref_namespaces for replace refs base
On 2022.07.29 19:29, Derrick Stolee via GitGitGadget wrote:
Show 14 quoted lines
> 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)