From: Junio C Hamano Date: Fri, 11 Sep 2026 16:55:19 GMT Subject: Re: [GSoC Patch v6 4/7] repo: add path.index with absolute and relative suffixes Message-ID: In-Reply-To: <20260911144519.1011780-5-jayatheerthkulkarni2005@gmail.com> K Jayatheerth writes: > +static int get_path_index_absolute(struct repository *repo, struct strbuf *buf) > +{ > + const char *index_file = repo_get_index_file(repo); > + > + if (!index_file) > + return error(_("unable to get index file")); This is a dead code, as repo_get_index_file() calls BUG("") when it finds that the repo instance is not ready to return this information. Hence I am debating myself if this is a better alternative: const char *index_file = repo->index_file; if (!index_file) return error(...); I dunno. > +static int get_path_index_relative(struct repository *repo, struct strbuf *buf) > +{ > + const char *index_file = repo_get_index_file(repo); > + > + if (!index_file) > + return error(_("unable to get index file")); > + > + format_path(buf, index_file, repo->prefix, PATH_FORMAT_RELATIVE); > + return 0; > +} Ditto.