Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remotes are sometimes not returned for worktree #1678

Open
zvirja opened this issue May 16, 2019 · 0 comments · May be fixed by #1680
Open

Remotes are sometimes not returned for worktree #1678

zvirja opened this issue May 16, 2019 · 0 comments · May be fixed by #1680

Comments

@zvirja
Copy link

zvirja commented May 16, 2019

Reproduction steps

  1. Create repository with remote and commit.
  2. Create branch and create a worktree from that branch.
  3. Copy the path to worktree and run the following code:
var worktreePath = "Here is your worktree path";
var repositoryPath = Repository.Discover(worktreePath);
var repo = new Repository(repositoryPath);

var before = repo.Network.Remotes.ToArray();
_ = repo.Head.RemoteName;
var after = repo.Network.Remotes.ToArray();

Expected behavior

Both before and after variable contain remote.

Actual behavior

The before variable contains remote, after is empty.

Version of LibGit2Sharp (release number or SHA1)

Latest master: 7f59d22c4fdb7b3d14511aca567e64eefaa43ab2

Operating system(s) tested; .NET runtime tested

Windows, .NET Framework 462 and .NET Core 2.1. I believe it doesn't matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant