libgit2 / libgit2/libgit2sharp

Remotes are sometimes not returned for worktree

未关闭
#1,678 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C#
星标
3.5k
派生
925
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先在最新的 master 上运行报告中的 C# 复现,重点关注使用关联 worktree 时的 Repository.Discover、repo.Network.Remotes 和 repo.Head.RemoteName。跟踪访问 Head.RemoteName 为什么会改变 remotes 的结果;当访问前后都包含该 repository remote 时即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, git
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。