From: Tian Yuchen Date: Sat, 28 Mar 2026 16:54:20 GMT Subject: Re: [PATCH v2 1/5] refs: make branchname helpers repository aware Message-ID: In-Reply-To: <20260328141146.1095115-2-shreyanshpaliwalcmsmn@gmail.com> Hi Shreyansh, On 3/28/26 22:09, Shreyansh Paliwal wrote: > @@ -5,6 +5,7 @@ > #include "refs.h" > #include "setup.h" > #include "strbuf.h" > +#include "repository.c" I'm surprised that it doesn't cause any errors. Or maybe you haven't build it yet? --- > -int check_branch_ref(struct strbuf *sb, const char *name) > +int check_branch_ref(struct repository *repo, struct strbuf *sb, const char *name) > { > if (startup_info->have_repository) > - copy_branchname(sb, name, INTERPRET_BRANCH_LOCAL); > + copy_branchname(repo, sb, name, INTERPRET_BRANCH_LOCAL); > else > strbuf_addstr(sb, name); > startup_info itself is a global variable, isn't it? I think a more appropriate approach is something like: if (repo && repo->gitdir) copy_branchname(repo, sb, name, INTERPRET_BRANCH_LOCAL); I dunno, just a thought. --- Regards, Yuchen