libgit2 / libgit2/libgit2sharp

Can't push all tags

Open
#1,552 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PowerShell example and the Repository.Network.Push entry point, comparing the individual-tag refspec with the wildcard forms shown in the issue. Reproduce the exception using PushOptions and refs/tags/*, then trace how the refspec is handled. Done means pushing all tags succeeds without the invalid-reference error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.