diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-22 09:45:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-22 09:45:22 -0700 |
commit | 6bead0c3203431ca63a6b1e7cf47c659f1a7021d (patch) | |
tree | 4d5d44220f9922186cc9132b483ccfbdfd5c42ea /t | |
parent | 223a923c37f76ee91eb6a9cb77ce6d31dcf939cc (diff) | |
parent | d8e1e5df950f2c514a01696a0a0ff53fb1a07651 (diff) | |
download | git-6bead0c3203431ca63a6b1e7cf47c659f1a7021d.tar.gz |
Merge branch 'sb/format-patch-signature'
* sb/format-patch-signature:
completion: Add --signature and format.signature
format-patch: Add a signature option (--signature)
Diffstat (limited to 't')
-rw-r--r-- | t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ | 3 | ||||
-rwxr-xr-x | t/t4014-format-patch.sh | 52 |
2 files changed, 55 insertions, 0 deletions
diff --git a/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ b/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ index 8dab4bf93e..1f0f9ad44b 100644 --- a/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ @@ -18,6 +18,9 @@ A U Thor (2): create mode 100644 file1 delete mode 100644 file2 +-- +g-i-t--v-e-r-s-i-o-n + From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index d21c37f3a2..f87434b9f8 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -613,4 +613,56 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' git format-patch --ignore-if-in-upstream HEAD ' +test_expect_success 'format-patch --signature' ' + git format-patch --stdout --signature="my sig" -1 >output && + grep "my sig" output +' + +test_expect_success 'format-patch with format.signature config' ' + git config format.signature "config sig" && + git format-patch --stdout -1 >output && + grep "config sig" output +' + +test_expect_success 'format-patch --signature overrides format.signature' ' + git config format.signature "config sig" && + git format-patch --stdout --signature="overrides" -1 >output && + ! grep "config sig" output && + grep "overrides" output +' + +test_expect_success 'format-patch --no-signature ignores format.signature' ' + git config format.signature "config sig" && + git format-patch --stdout --signature="my sig" --no-signature \ + -1 >output && + ! grep "config sig" output && + ! grep "my sig" output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --signature --cover-letter' ' + git config --unset-all format.signature && + git format-patch --stdout --signature="my sig" --cover-letter \ + -1 >output && + grep "my sig" output && + test 2 = $(grep "my sig" output | wc -l) +' + +test_expect_success 'format.signature="" supresses signatures' ' + git config format.signature "" && + git format-patch --stdout -1 >output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --no-signature supresses signatures' ' + git config --unset-all format.signature && + git format-patch --stdout --no-signature -1 >output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --signature="" supresses signatures' ' + git format-patch --signature="" -1 >output && + ! grep "^-- \$" output +' + test_done |