Thread (19 messages) 19 messages, 6 authors, 2025-06-02

Re: [PATCH] fsck: ignore missing "refs" directory for linked worktrees

From: shejialuo <hidden>
Date: 2025-06-02 12:41:51

On Sat, May 31, 2025 at 11:39:18AM +0800, shejialuo wrote:
+test_expect_success 'no refs directory of worktree should not cause problems' '
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&
+		test_commit initial &&
+
+		git worktree add --detach ./worktree &&
+		# Simulate old directory layout
+		rm -rf ./git/worktrees/worktree/refs &&
FYI. I made a mistake here, it should be ".git/worktrees" but not "./git".
+		git refs verify 2>err &&
+		test_must_be_empty err
+	)
+'
+
 test_expect_success 'ref name check should work for multiple worktrees' '
 	test_when_finished "rm -rf repo" &&
 	git init repo &&
-- 
2.49.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help