project: Fix issue where Cmd+Click on an import opens the wrong file (#26120)

Closes #21974

`resolve_path_in_worktrees` function looks for provided path in each
worktree until valid file is found.

In this PR we priortize current buffer worktree before other worktrees,
because of edge case where, file with same name might exists in other
worktrees.

Updated tests to handle this case.

Release Notes:

- Fixed an issue where the wrong file from a different worktree would
open when using `Cmd + Click` on a file import.
387ee46c46smit committed on 3/5/2025, 11:19:39 AM· committed by GitHubparent89d89b8
2 files changedLine totals unavailable