libgit2 / libgit2/libgit2sharp

Can't push all tags

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

还没有人认领这个 Issue。

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

描述

When I try to push all tags, I get this exception:

LibGit2Sharp.LibGit2SharpException: not a valid reference 'refs/tags/*'
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_push(RemoteHandle remote, IEnumerable`1 refSpecs, GitPushOptions opts)
   at LibGit2Sharp.Network.Push(Remote remote, IEnumerable`1 pushRefSpecs, PushOptions pushOptions)
   at CallSite.Target(Closure , CallSite , Object , Object , Object , Object )

Here's my PowerShell code:

$pushOptions = New-Object -TypeName 'LibGit2Sharp.PushOptions'
$repo = New-Object 'LibGit2Sharp.Repository' ($RepoRoot)
$remote = $repo.Network.Remotes | Where-Object { $_.Name -eq 'origin' }
$repo.Network.Push($remote, 'refs/tags/*', $pushOptions)

I've also tried using refs/tags/*:refs/tags/* as the refspec, but that fails too. I can push individual tags with refspec refs/tags/tag_name.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 PowerShell 示例和 Repository.Network.Push 入口点开始,将单个标签的 refspec 与 issue 中显示的通配符形式进行比较。使用 PushOptions 和 refs/tags/* 重现异常,然后跟踪 refspec 的处理过程。当推送所有标签时不再出现无效引用错误并成功完成,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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