Re: [PATCH 2/2] tests: teach verify_parents to check for extra parents

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Currently verify_parents only makes sure that the earlier parents of
> HEAD match the commits given, and does not care if there are more
> parents.  This makes it harder than one would like to check that, for
> example, parent reduction works correctly when making an octopus.
>
> Fix it by checking that HEAD^(n+1) is not a valid commit name.
> Noticed while working on a new test that was supposed to create a
> fast-forward one commit ahead but actually created a merge.
>
> Reported-by: Junio C Hamano <gitster@xxxxxxxxx>
> Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
> ---
>  t/t7600-merge.sh |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
> index c665acd..9af748a 100755
> --- a/t/t7600-merge.sh
> +++ b/t/t7600-merge.sh
> @@ -89,6 +89,7 @@ verify_parents () {
>  		i=$(expr $i + 1) ||
>  		return 1
>  	done &&
> +	test_must_fail git rev-parse --verify HEAD^$(($# + 1)) &&

Isn't $i at this point the same as that complex $(()) line noise?

>  	test_cmp parents.expected parents.actual
>  }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]