Re: [PATCH 1/3] rebase: teach rebase --keep-base

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denton Liu <liu.denton@xxxxxxxxx> writes:

>  	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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux