Andrei Rybak <rybak.a.v@xxxxxxxxx> writes: > diff --git a/builtin/rebase.c b/builtin/rebase.c > index 4a20582e72..9457912f9d 100644 > --- a/builtin/rebase.c > +++ b/builtin/rebase.c > @@ -1595,6 +1595,21 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) > trace2_cmd_mode(action_names[action]); > } > > + for (i = 0; i < exec.nr; i++) > + if (check_exec_cmd(exec.items[i].string)) > + exit(1); > + > + if (exec.nr) { > + int i; This masks the outer "i" (I am assuming such a thing exists, judging from its use in the above loop you added), but I do not see a need for it. With or without this masked local "i", the value of outer "i" will be equal to exec.nr+1 after the control leaves this if block. > + imply_interactive(&options, "--exec"); > + > + strbuf_reset(&buf); > + for (i = 0; i < exec.nr; i++) > + strbuf_addf(&buf, "exec %s\n", exec.items[i].string); > + options.cmd = xstrdup(buf.buf); > + } > +