git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t2401: fix misfiring substitution when path contains w2

From
Anders Kaseorg <andersk@mit.edu>
Date
Nov 11, 2026, 07:55 UTC
Message-ID
<20261110-t2401-substitution-v1-1-32f3524f2b92@mit.edu>

Fixes a test failure when running inside a trash directory that already contains w2 as a substring, as can be reproduced with

  ./t2401-worktree-prune.sh --root=/tmp/foow2bar
Fixes: 4a3ce479ce7c ("worktree: prune duplicate entries referencing same worktree path")
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
 t/t2401-worktree-prune.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index 3d28c7f06b..5a2c998513 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -99,8 +99,7 @@ test_expect_success 'prune duplicate (linked/linked)' '
 	test_when_finished rm -fr .git/worktrees w1 w2 &&
 	git worktree add --detach w1 &&
 	git worktree add --detach w2 &&
-	sed "s/w2/w1/" .git/worktrees/w2/gitdir >.git/worktrees/w2/gitdir.new &&
-	mv .git/worktrees/w2/gitdir.new .git/worktrees/w2/gitdir &&
+	cp .git/worktrees/w1/gitdir .git/worktrees/w2/gitdir &&
 	git worktree prune --verbose 2>actual &&
 	test_i18ngrep "duplicate entry" actual &&
 	test -d .git/worktrees/w1 &&

---
base-commit: da8fb6be5594b4a06ef2cc2ff7a5363a6fac2b5a
change-id: 20261110-t2401-substitution-3ab4819833a1

Best regards,
--  
Anders Kaseorg <andersk@mit.edu>
Next: Junio C Hamano
Message 1 of 2 in “t2401: fix misfiring substitution when path contains w2”
  1. t2401: fix misfiring substitution when path contains w2Anders Kaseorg, Nov 11, 2026
  2. Junio C HamanoNov 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.