On Thu, Feb 9, 2017 at 1:19 PM, Junio C Hamano <gitster@xxxxxxxxx> 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.