Re: [GSoC][PATCH 2/3] rebase -i: rewrite setup_reflog_action() in C
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 19, 2018, 06:51 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1806190848320.77@tvgsbejvaqbjf.bet>
- In-Reply-To
- <CAGZ79kaLSCXSDHN8=L-FCBvQ9jRJqit6VFNK3VmHm9H07ThEsg@mail.gmail.com>
Hi Stefan,
On Mon, 18 Jun 2018, Stefan Beller wrote:
Show 13 quoted lines
> On Mon, Jun 18, 2018 at 6:19 AM Alban Gruin <alban.gruin@gmail.com> wrote:
> >
> > +int setup_reflog_action(struct replay_opts *opts, const char *commit,
> > + int verbose)
> > +{
> > + const char *action;
> > +
> > + if (commit && *commit) {
>
> While this is defensive programming (checking the pointer before dereferencing
> it, the first condition (commit == NULL) should never be false here,
> as the caller
> checks for argc == 2 ?But it is not marked as `static` (or is it?). So we should not rely on the caller to Do The Right Thing.
Ciao, Dscho