Skip to content

Commit 428c924

Browse files
tmzullingergitster
authored andcommitted
t: avoid git config syntax from newer releases
In a recent security release, 05e9cd6 (config: quote values containing CR character, 2025-05-19) added calls to `git config get`, `git config set`, and `git config unset` which are not present on the maint-2.43 branch. These subcommands were added in the following commits, released in git-2.46.0: 4e51389 (builtin/config: introduce "get" subcommand, 2024-05-06), 00bbdde (builtin/config: introduce "set" subcommand, 2024-05-06), 95ea69c (builtin/config: introduce "unset" subcommand, 2024-05-06) Revert to the previous `git config` syntax for older maintenance branches. Signed-off-by: Todd Zullinger <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 05e9cd6 commit 428c924

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

t/t1300-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,8 +2595,8 @@ test_expect_success 'writing value with trailing CR not stripped on read' '
25952595
25962596
printf "bar\r\n" >expect &&
25972597
git init cr-test &&
2598-
git -C cr-test config set core.foo $(printf "bar\r") &&
2599-
git -C cr-test config get core.foo >actual &&
2598+
git -C cr-test config core.foo $(printf "bar\r") &&
2599+
git -C cr-test config --get core.foo >actual &&
26002600
26012601
test_cmp expect actual
26022602
'

t/t7450-bad-git-dotfiles.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d
362362
git -C repo mv sub $(printf "sub\r") &&
363363
364364
# Ensure config values containing CR are wrapped in quotes.
365-
git config unset -f repo/.gitmodules submodule.sub.path &&
365+
git config --unset -f repo/.gitmodules submodule.sub.path &&
366366
printf "\tpath = \"sub\r\"\n" >>repo/.gitmodules &&
367367
368-
git config unset -f repo/.git/modules/sub/config core.worktree &&
368+
git config --unset -f repo/.git/modules/sub/config core.worktree &&
369369
{
370370
printf "[core]\n" &&
371371
printf "\tworktree = \"../../../sub\r\"\n"

0 commit comments

Comments
 (0)