diff mbox series

[v3,4/8] t1300: add test for --replace-all with value-pattern

Message ID 75fb74da8324674194cca2b27fc4e6c0fdc6486d.1606342377.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit d15671943e763902c7a9c070a988f3b0489f11f7
Headers show
Series config: add --fixed-value option | expand

Commit Message

Derrick Stolee Nov. 25, 2020, 10:12 p.m. UTC
From: Derrick Stolee <dstolee@microsoft.com>

The --replace-all option was added in 4ddba79d (git-config-set: add more
options) but was not tested along with the 'value-pattern' parameter.
Since we will be updating this option to optionally treat 'value-pattern'
as a fixed string, let's add a test here that documents the current
behavior.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 t/t1300-config.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 72f930ada0..040b9f7506 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1953,4 +1953,18 @@  test_expect_success 'set all config with value-pattern' '
 	test_cmp expect actual
 '
 
+test_expect_success '--replace-all and value-pattern' '
+	test_when_finished rm -f config &&
+	git config --file=config --add abc.key one &&
+	git config --file=config --add abc.key two &&
+	git config --file=config --add abc.key three &&
+	git config --file=config --replace-all abc.key four "o+" &&
+	git config --file=config --list >actual &&
+	cat >expect <<-\EOF &&
+	abc.key=four
+	abc.key=three
+	EOF
+	test_cmp expect actual
+'
+
 test_done