fix(remote): send named tag refspecs instead of refs/tags/* - #35
Conversation
f13bb7d to
b36deb6
Compare
cheat2001
left a comment
There was a problem hiding this comment.
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.
b36deb6 to
96de163
Compare
What & why
Fixes #34.
Push with tags sends
refs/tags/*:refs/tags/*. libgit2Remote::pushdoes not expand that glob — it looks up a literal ref namedrefs/tags/*and fails withclass=Invalid (3).git push --tagsexpands the glob locally first. Single-tagpush_tagalready 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_refsagainst a local bare remote.Screenshots
N/A — engine behavior only.
Checklist
tests/git_engine.rspush_refspecsunit tests name tags instead of the globcargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test(Rust CI)Made with Cursor