Re: [PATCH v4] submodule: port subcommand 'set-url' from shell to C
- From
Shourya Shukla <shouryashukla.oo@gmail.com>
- Date
- May 6, 2020, 16:31 UTC
- Message-ID
- <20200506163128.GA14899@konoha>
- In-Reply-To
- <CAP8UFD0o7WwibV8+cwYOO949BkBggSphi0zbgPUZsk6nfvYyHQ@mail.gmail.com>
On 06/05 10:09, Christian Couder wrote:
Show 10 quoted lines
> > + strbuf_addf(&config_name, "submodule.%s.url", path); > > + > > + config_set_in_gitmodules_file_gently(config_name.buf, newurl); > > + sync_submodule(path, prefix, quiet ? OPT_QUIET : 0); > > + > > + strbuf_release(&config_name); > > Nit: it might be a bit simpler to define config_name as a "char *", > and then use xstrfmt() and free() instead of strbuf_addf() and > strbuf_release().
Apart from the simplicity purposes, does doing this aid in performance in any way?
> > + return 0; > > +}