Re: [PATCH v2 1/1] sequencer: fix empty commit check when amending

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

 



"Phillip Wood via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> +	if (!(flags & ALLOW_EMPTY)) {
> +		struct commit *first_parent = current_head;
> +
> +		if (flags & AMEND_MSG) {
> +			if (current_head->parents) {

It is not apparent to me that somebody guarantees that this access
is safe; would we need to do things differently when !current_head?

> +				first_parent = current_head->parents->item;
> +				if (repo_parse_commit(r, first_parent)) {
> +					res = error(_("could not parse HEAD commit"));
> +					goto out;
> +				}
> +			} else {
> +				first_parent = NULL;
> +			}
> +		}



[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