Re: [PATCH v4 3/6] rebase -i: support --committer-date-is-author-date

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

 



On Fri, 4 Oct 2019 10:37:43 +0100 Phillip Wood <phillip.wood123@xxxxxxxxx> wrote:
>
> > +	if (opts->committer_date_is_author_date) {
> > +		int len = strlen(author);
> > +		struct ident_split ident;
> > +		struct strbuf date = STRBUF_INIT;
> > +
> > +		if (split_ident_line(&ident, author, len) < 0)
> > +			return error(_("malformed ident line"));
>
> Here (and just below) we return if there is an error but later on we 
> `goto out` should we be doing that here to clean something up?

Yes, a mistake indeed. This should be replace with an error and a
goto statement.

> Best Wishes
>
> Phillip
>
> > +		if (!ident.date_begin)
> > +			return error(_("corrupted author without date information"));
> > +
> > +		strbuf_addf(&date, "@%.*s %.*s",
> > +			    (int)(ident.date_end - ident.date_begin), ident.date_begin,
> > +			    (int)(ident.tz_end - ident.tz_begin), ident.tz_begin);
> > +		res = setenv("GIT_COMMITTER_DATE", date.buf, 1);
> > +		strbuf_release(&date);
> > +
> > +		if (res)
> > +			goto out;
> > +	}
> > +

Thanks
Rohit




[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