Skip to content

Commit d156719

Browse files
derrickstoleegitster
authored andcommitted
t1300: add test for --replace-all with value-pattern
The --replace-all option was added in 4ddba79 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2076dba commit d156719

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t1300-config.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,4 +1956,18 @@ test_expect_success 'set all config with value-pattern' '
19561956
test_cmp expect actual
19571957
'
19581958

1959+
test_expect_success '--replace-all and value-pattern' '
1960+
test_when_finished rm -f config &&
1961+
git config --file=config --add abc.key one &&
1962+
git config --file=config --add abc.key two &&
1963+
git config --file=config --add abc.key three &&
1964+
git config --file=config --replace-all abc.key four "o+" &&
1965+
git config --file=config --list >actual &&
1966+
cat >expect <<-\EOF &&
1967+
abc.key=four
1968+
abc.key=three
1969+
EOF
1970+
test_cmp expect actual
1971+
'
1972+
19591973
test_done

0 commit comments

Comments
 (0)