From: Jeff King Date: Thu, 10 Dec 2015 18:02:13 GMT Subject: Re: [PATCH 13/16] init: allow alternate backends to be set for new repos Message-ID: <20151210180213.GA27152@sigill.intra.peff.net> In-Reply-To: <1449102921-7707-14-git-send-email-dturner@twopensource.com> 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. -Peff