Re: [PATCH 1/3] rebase: teach rebase --keep-base
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 24, 2019, 13:37 UTC
- Message-ID
- <xmqqpnqgo0k2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <f802e5442013613221a4efd8ef1fecce0f3a9914.1553354374.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 8 quoted lines
> if (strstr(options.onto_name, "...")) {
> if (get_oid_mb(options.onto_name, &merge_base) < 0)
> + if (keep_base)
> + die(_("'%s': need exactly one merge base with branch"),
> + options.upstream_name);
> + else
> die(_("'%s': need exactly one merge base"),
> options.onto_name);If you turn a single statement body into if/else, have {} around the body of the outer if, i.e.
if (get_oid_mb(...) < 0) {
if (keep_base)
die(_("'%s': need exactly one merge base with branch"),
options.upstream_name);
else
die(_("'%s': need exactly one merge base"),
options.onto_name);
}Otherwise -Werror=danglng-else will stop compilation.
Thanks.