Thread (4 messages) 4 messages, 3 authors, 2016-06-15

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

From: Remi Galan Alfonso <hidden>
Date: 2016-06-15 23:05:31

Caio Marcelo de Oliveira Filho [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help