Skip to content

fix(remote): send named tag refspecs instead of refs/tags/* - #35

Merged
cheat2001 merged 2 commits into
cheat2001:mainfrom
noyobo:fix-34-push-with-tags
Sep 22, 2026
Merged

cheat2001 merged 2 commits into
cheat2001:mainfrom
noyobo:fix-34-push-with-tags

Conversation

@noyobo

@noyobo noyobo commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Fixes #34.

Push with tags sends refs/tags/*:refs/tags/*. libgit2 Remote::push does not expand that glob — it looks up a literal ref named refs/tags/* and fails with class=Invalid (3). git push --tags expands the glob locally first. Single-tag push_tag already uses a named spec and works.

The engine now lists local tags and pushes refs/tags/{name}:refs/tags/{name} next to the branch spec. Force still prefixes only the branch. Regression: push_with_tags_sends_named_tag_refs against a local bare remote.

Screenshots

N/A — engine behavior only.

Checklist

  • New engine coverage in tests/git_engine.rs
  • push_refspecs unit tests name tags instead of the glob
  • No UI / design-token / undo changes
  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test (Rust CI)

Made with Cursor

@noyobo
noyobo force-pushed the fix-34-push-with-tags branch 2 times, most recently from f13bb7d to b36deb6 Compare September 20, 2026 14:20

@cheat2001 cheat2001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is the right fix. libgit2 really does treat the glob as a literal ref, and naming each tag is what git push --tags does under the hood anyway. Green on all three OSes.

One thing before I merge: the repo keeps source files free of comments, doc comments included (CLAUDE.md §6.5). Can you drop the /// line on push_refspecs and put that note into CLAUDE.md instead, next to the remote.rs entry (the line that says "with_tags always pushes")? Bump the Rust integration count in §9 while you're there.

Not for this PR, but worth knowing: we don't set a push_update_reference callback, so a tag the server rejects (a local v1.0 pointing somewhere else than the remote's) still comes back as a plain "Pushed". Sending every tag makes that case more likely. I'll open an issue for it.

libgit2 Remote::push looks up the glob as a literal ref. Enumerate local tags
and push refs/tags/{name}:refs/tags/{name} so Push with tags works.
@cheat2001
cheat2001 force-pushed the fix-34-push-with-tags branch from b36deb6 to 96de163 Compare September 22, 2026 16:00
@cheat2001
cheat2001 merged commit 96de163 into cheat2001:main Sep 22, 2026
6 checks passed
@noyobo
noyobo deleted the fix-34-push-with-tags branch September 22, 2026 22:11
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 this pull request may close these issues.

Remote::push rejects the refs/tags/* glob used by Push with tags

2 participants