@@ -42,16 +42,35 @@ describe("findDockerGitConfigPaths", () => {
4242 const includedNested = path . join ( root , "org/repo-b/nested/docker-git.json" )
4343 const ignoredGit = path . join ( root , "org/repo-a/.git/docker-git.json" )
4444 const ignoredOrch = path . join ( root , "org/repo-a/.orch/docker-git.json" )
45+ const ignoredRootCache = path . join ( root , ".cache/packages/pnpm/store/v10/index/docker-git.json" )
4546 const ignoredDockerGit = path . join ( root , ".docker-git/.cache/git-mirrors/docker-git.json" )
4647
4748 yield * _ ( writeFileWithParents ( fs , path , includedMain ) )
4849 yield * _ ( writeFileWithParents ( fs , path , includedNested ) )
4950 yield * _ ( writeFileWithParents ( fs , path , ignoredGit ) )
5051 yield * _ ( writeFileWithParents ( fs , path , ignoredOrch ) )
52+ yield * _ ( writeFileWithParents ( fs , path , ignoredRootCache ) )
5153 yield * _ ( writeFileWithParents ( fs , path , ignoredDockerGit ) )
5254
5355 const found = yield * _ ( findDockerGitConfigPaths ( fs , path , root ) )
5456 expect ( [ ...found ] . sort ( ) ) . toEqual ( [ includedMain , includedNested ] . sort ( ) )
5557 } )
5658 ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
59+
60+ it . effect ( "skips broken symlinks without failing search" , ( ) =>
61+ withTempDir ( ( root ) =>
62+ Effect . gen ( function * ( _ ) {
63+ const fs = yield * _ ( FileSystem . FileSystem )
64+ const path = yield * _ ( Path . Path )
65+ const includedMain = path . join ( root , "org/repo-a/docker-git.json" )
66+ const brokenLink = path . join ( root , "org/repo-a/broken-link" )
67+ const missingTarget = path . join ( root , "org/repo-a/missing-target" )
68+
69+ yield * _ ( writeFileWithParents ( fs , path , includedMain ) )
70+ yield * _ ( fs . symlink ( missingTarget , brokenLink ) )
71+
72+ const found = yield * _ ( findDockerGitConfigPaths ( fs , path , root ) )
73+ expect ( found ) . toEqual ( [ includedMain ] )
74+ } )
75+ ) . pipe ( Effect . provide ( NodeContext . layer ) ) )
5776} )
0 commit comments