libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Working Directory for a branch seems to be incorrect.

Open devmikew opened this issue 3 years ago • 0 comments

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.

  1. Create a work tree and an associated branch.
  2. Create the Repository in code (pointing to the Repositories path).
  3. Examine all the branches by iterating through Repos.Branches.
  4. The working directory of the new branch is pointing to the working directory of the Repository, not the path to the work tree.

Version of LibGit2Sharp (release number or SHA1)

<PackageReference Include="LibGit2Sharp" Version="0.26.2" />

Operating system(s) tested; .NET runtime tested

VS 2022, Win 11 <TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>

I know how to get the correct path if you think it is a bug.

devmikew avatar Jun 03 '22 22:06 devmikew