summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2016-07-30 09:41:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-01 20:13:02 (GMT)
commit6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d (patch)
tree05343b68df9de90923ea0fc2d3088f86321d2816 /t
parent08df31eeccfe1576971ea4ba42570a424c3cfc41 (diff)
downloadgit-6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d.zip
git-6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d.tar.gz
git-6bc6b6c0dc0a58874a7a6b9afc3156a5cf9bb10d.tar.bz2
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')
-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 805dc90..8109e46 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 \