I think there is an error in the Working Directory for a branch, particularly if a branch is associated with a WorkTree.
It always shows the same path as the Repository. However if a branch is associated with a work tree, it's working directory is probably not the same as the repository.
Create a work tree and an associated branch.
Create the Repository in code (pointing to the Repositories path).
Examine all the branches by iterating through Repos.Branches.
The working directory of the new branch is pointing to the working directory of the Repository, not the path to the work tree.
I think there is an error in the Working Directory for a branch, particularly if a branch is associated with a WorkTree.
It always shows the same path as the Repository. However if a branch is associated with a work tree, it's working directory is probably not the same as the repository.
Version of LibGit2Sharp (release number or SHA1)
Operating system(s) tested; .NET runtime tested
VS 2022, Win 11
I know how to get the correct path if you think it is a bug.