summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorLibravatar Josh Triplett <josh@joshtriplett.org>2016-07-30 02:41:56 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-08-01 13:13:02 -0700
commit6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d (patch)
tree05343b68df9de90923ea0fc2d3088f86321d2816 /t/t4014-format-patch.sh
parentSome fixes for 2.9.3 (diff)
downloadtgif-6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d.tar.xz
format-patch: format.from gives the default for --from
This helps users who would prefer format-patch to default to --from, and makes it easier to change the default in the future. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-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 805dc9012d..8109e46dc7 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 \