]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1300: add test for --replace-all with value-pattern
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 25 Nov 2020 22:12:52 +0000 (22:12 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Nov 2020 22:43:48 +0000 (14:43 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1300-config.sh

index a74bcb4c858ec994493036b9a8a46af40418e000..bddf5250dc41bf16e62590f67949ad1690484cfc 100755 (executable)
@@ -1956,4 +1956,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