libgit2 / libgit2/libgit2sharp

Deleted tags show up in the list

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

还没有人认领这个 Issue。

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

描述

Reproduction steps
  1. Add a new tag in github repository online (www.github.com).
  2. Run .Net core Controller.
  3. Added tag show up in the Api.
  4. Delete a tag in github repository online.
  5. Run controller and API.
  6. Deleted tag show up in API Controller.
  7. _repository = new Repository("localfolderpath");
     var network = _repository.Network.Remotes.First();
     var refSpecs = new List<string>() { network.FetchRefSpecs.First().Specification };
     var fetchOptions = new FetchOptions { TagFetchMode = TagFetchMode.All };
     fetchOptions.CredentialsProvider = (_url, _user, _cred) => new DefaultCredentials();
     fetchOptions.CredentialsProvider += (_url, _user, _cred) => _userNamePasswordCredentials;
    
     Commands.Pull(_repository, new Signature(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), DateTime.Now), new PullOptions()
     {
         FetchOptions = fetchOptions,
         MergeOptions = new MergeOptions()
         {
             MergeFileFavor = MergeFileFavor.Theirs,
             CommitOnSuccess = true
         }
     });
    
     foreach (Remote remote in _repository.Network.Remotes)
     {
         Commands.Fetch(_repository, remote.Name, new string[0], fetchOptions, null);
         _repository.Network.Fetch(remote.Name, remote.FetchRefSpecs.Select(r => r.Specification), fetchOptions);
     }
    
Expected behavior
  1. Deleted tags shouldn't come up when using _repository.Tags
Actual behavior
  1. Deleted tags come up in _repository.Tags
Version of LibGit2Sharp (release number or SHA1)

Libgit2Sharp 0.26.2

Operating system(s) tested; .NET runtime tested

.Net Core 3.5, Microsoft Visual Studio Professional 2019 Version 16.9.0, .Net Framework 4.7.03190, Microsoft windows 10 pro.

贡献指南

打开贡献指南

从这里开始

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

调研方向

使用所示的 Pull 和 Fetch 调用通过 LibGit2Sharp 0.26.2 重现该问题,然后检查远程标签被删除后 _repository.Tags 是如何填充的。将获取的 refs 与预期的标签列表进行比较;当已删除的远程标签不再出现在 _repository.Tags 中时即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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