aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-10 14:23:17 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-10 14:23:17 -0700
commit9a8aebae972de22ecd5adb92fec9d77147949c8a (patch)
treede2a54941699c4856071e6536966af4ba8f2ac5f /t
parentd181b9354cf85b44455ce3ca9e6af0b9559e0ae2 (diff)
parentea3a62c40ef2d31a6ab87ae3b8be46690d549b58 (diff)
downloadgit-9a8aebae972de22ecd5adb92fec9d77147949c8a.tar.xz
Merge branch 'kh/format-patch-noprefix-is-boolean'
The configuration variable format.noprefix did not behave as a proper boolean variable, which has now been fixed and documented. * kh/format-patch-noprefix-is-boolean: doc: diff-options.adoc: make *.noprefix split translatable doc: diff-options.adoc: show format.noprefix for format-patch format-patch: make format.noprefix a boolean
Diffstat (limited to 't')
-rwxr-xr-xt/t4014-format-patch.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 2135b65cee..bcdb944017 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -2549,10 +2549,26 @@ test_expect_success 'format-patch respects format.noprefix' '
grep "^--- blorp" actual
'
+test_expect_success 'format.noprefix=false' '
+ git -c format.noprefix=false format-patch -1 --stdout >actual &&
+ grep "^--- a/blorp" actual
+'
+
test_expect_success 'format-patch --default-prefix overrides format.noprefix' '
git -c format.noprefix \
format-patch -1 --default-prefix --stdout >actual &&
grep "^--- a/blorp" actual
'
+test_expect_success 'errors on format.noprefix which is not boolean' '
+ cat >expect <<-EOF &&
+ fatal: bad boolean config value ${SQ}not-a-bool${SQ} for ${SQ}format.noprefix${SQ}
+ hint: ${SQ}format.noprefix${SQ} used to accept any value and treat that as ${SQ}true${SQ}.
+ hint: Now it only accepts boolean values, like what ${SQ}diff.noprefix${SQ} does.
+ EOF
+ test_must_fail git -c format.noprefix=not-a-bool \
+ format-patch -1 --stdout 2>actual &&
+ test_cmp expect actual
+'
+
test_done