From: Stefan Beller Date: Thu, 09 Feb 2017 21:36:51 GMT Subject: Re: [PATCH 4/5] files_ref_store::submodule: use NULL for the main repository Message-ID: In-Reply-To: On Thu, Feb 9, 2017 at 1:19 PM, Junio C Hamano wrote: >> if (!submodule || !*submodule) >> - return be->init(NULL); >> + refs = be->init(NULL); >> else >> - return be->init(submodule); >> + refs = be->init(submodule); > > Can't we also lose this "if !*submodule, turn it to NULL"? That was my suggestion as well, but that did not look nicer per se. That is because at this point of the series we still handle "" just fine. >> refs->submodule = submodule ? xstrdup(submodule) : ""; > > Also, can't we use xstrdup_or_null(submodule) with this step? > That is done in 4/5; here we must keep a "" around instead of NULL IIUC.