]> git.ipfire.org Git - thirdparty/git.git/commit
worktree list: quote paths
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 18 Nov 2025 16:07:33 +0000 (16:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Nov 2025 18:11:29 +0000 (10:11 -0800)
commit08dfa5983572645ae7cc51b49cadfdf216ecfec6
tree9bc0e28b9ba3403a9facdadf1a209703adf33fd6
parenta6238ee16371247517e39da36782614a229184ff
worktree list: quote paths

If a worktree path contains newlines or other control characters
it messes up the output of "git worktree list". Fix this by using
quote_path() to display the worktree path. The output of "git worktree
list" is designed for human consumption, scripts should be using the
"--porcelain" option so this change should not break them.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
t/t2402-worktree-list.sh