summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-10 19:33:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-10 19:33:18 (GMT)
commitdb40a622395397c84c247d343ef62acc8775d6b2 (patch)
tree505448d2b765d17ce009e12809315fb07bb457d4 /t
parente6747627865347a534e7106bb1d14e32867b234d (diff)
parent6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d (diff)
downloadgit-db40a622395397c84c247d343ef62acc8775d6b2.zip
git-db40a622395397c84c247d343ef62acc8775d6b2.tar.gz
git-db40a622395397c84c247d343ef62acc8775d6b2.tar.bz2
Merge branch 'jt/format-patch-from-config'
"git format-patch" learned format.from configuration variable to specify the default settings for its "--from" option. * jt/format-patch-from-config: format-patch: format.from gives the default for --from
Diffstat (limited to 't')
-rwxr-xr-xt/t4014-format-patch.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 1206c48..b0579dd 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -229,6 +229,46 @@ check_patch () {
grep -e "^Subject:" "$1"
}
+test_expect_success 'format.from=false' '
+
+ git -c format.from=false format-patch --stdout master..side |
+ sed -e "/^\$/q" >patch &&
+ check_patch patch &&
+ ! grep "^From: C O Mitter <committer@example.com>\$" patch
+'
+
+test_expect_success 'format.from=true' '
+
+ git -c format.from=true format-patch --stdout master..side |
+ sed -e "/^\$/q" >patch &&
+ check_patch patch &&
+ grep "^From: C O Mitter <committer@example.com>\$" patch
+'
+
+test_expect_success 'format.from with address' '
+
+ git -c format.from="F R Om <from@example.com>" format-patch --stdout master..side |
+ sed -e "/^\$/q" >patch &&
+ check_patch patch &&
+ grep "^From: F R Om <from@example.com>\$" patch
+'
+
+test_expect_success '--no-from overrides format.from' '
+
+ git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout master..side |
+ sed -e "/^\$/q" >patch &&
+ check_patch patch &&
+ ! grep "^From: F R Om <from@example.com>\$" patch
+'
+
+test_expect_success '--from overrides format.from' '
+
+ git -c format.from="F R Om <from@example.com>" format-patch --from --stdout master..side |
+ sed -e "/^\$/q" >patch &&
+ check_patch patch &&
+ ! grep "^From: F R Om <from@example.com>\$" patch
+'
+
test_expect_success '--no-to overrides config.to' '
git config --replace-all format.to \