Re: [PATCH] commit: add commit.signoff config option

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

 



Caio Marcelo de Oliveira Filho <cmarcelo@xxxxxxxxx> writes:
> +test_expect_success 'commit.signoff config option' '
> +        git config commit.signoff true &&
> +        echo "yet another content *narf*" >> foo &&
> +        echo "zort" | git commit -F - foo &&
> +        git cat-file commit HEAD | sed "1,/^\$/d" > output &&
> +        git config --unset commit.signoff &&
> +        test_cmp expect output
> +'
> +
> +cat > expect <<EOF
> +no signed off by here
> +EOF
> +
> +test_expect_success '--no-signoff' '
> +        git config commit.signoff true &&
> +        echo "yet another content *narf*" >> foo &&
> +        echo "no signed off by here" | git commit --no-signoff -F - foo &&
> +        git cat-file commit HEAD | sed "1,/^\$/d" > output &&
> +        git config --unset commit.signoff &&
> +        test_cmp expect output
> +'
> +

In both tests, you should probably use 'test_config' instead of 'git
config [...] git config --unset', it takes care of it for you (also
should prevent the case where the config is not unset when your test
fails in the middle).

For example, the first test would be:
test_expect_success 'commit.signoff config option' '
	test_config commit.signoff true &&
	echo "yet another content *narf*" >> foo &&
	echo "zort" | git commit -F - foo &&
	git cat-file commit HEAD | sed "1,/^\$/d" > output &&
	test_cmp expect output
'

Rémi
--
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]