Re: [PATCH 13/16] init: allow alternate backends to be set for new repos
- From
David Turner <dturner@twopensource.com>
- Date
- Dec 10, 2015, 19:36 UTC
- Message-ID
- <1449776161.21906.1.camel@twopensource.com>
- In-Reply-To
- <20151210180213.GA27152@sigill.intra.peff.net>
On Thu, 2015-12-10 at 13:02 -0500, Jeff King wrote:
Show 22 quoted lines
> On Wed, Dec 02, 2015 at 07:35:18PM -0500, David Turner wrote:
>
> > @@ -510,9 +511,36 @@ int validate_headref(const char *path)
> > unsigned char sha1[20];
> > int fd;
> > ssize_t len;
> > + struct refdb_config_data refdb_data = {NULL, NULL};
> > +
> > + if (lstat(path, &st) < 0) {
> > + int backend_type_set;
> > + struct strbuf config_path = STRBUF_INIT;
> > + if (path) {
> > + char *pathdup = xstrdup(path);
> > + char *git_dir = dirname(pathdup);
> > + strbuf_addf(&config_path, "%s/%s", git_dir, "config");
> > + free(pathdup);
> > + } else {
> > + strbuf_addstr(&config_path, "config");
> > + }
>
> Can we ever follow this "else" branch? It would mean feeding NULL to
> lstat.Probably cruft from an old version of the patch. Removed if/else. Thanks.