remote: honor explicit tag fetch destinations by sairex53 · Pull Request #7440 · libgit2/libgit2 · GitHub
Skip to content

remote: honor explicit tag fetch destinations - #7440

Open
sairex53 wants to merge 1 commit into
libgit2:mainfrom
sairex53:fix-7438-explicit-tag-refspec
Open

sairex53 wants to merge 1 commit into
libgit2:mainfrom
sairex53:fix-7438-explicit-tag-refspec

Conversation

@sairex53

Copy link
Copy Markdown

In AUTO tag mode, refs/tags/hard_tag:refs/custom/tag silently ignores the requested destination, and +refs/tags/*:refs/tags/* does not replace an existing tag. Tag auto-following currently runs before the explicit refspec mapping.

Prefer a matching refspec with a destination before applying auto-following. This honors the destination and force flag and keeps the output buffer empty for exact refspec transforms.

Three regression tests fail before the fix and pass afterward: exact destination, wildcard destination, and forced update. A fourth checks that ordinary auto-following preserves an existing local tag.

Validation on Fedora AArch64: all 201 selected remote, local-fetch, fetch, and FETCH_HEAD tests pass.

Fixes #7438.

Tag auto-following takes precedence over an explicit fetch refspec in
AUTO mode. This ignores custom destinations and prevents forced tag
updates.

Apply auto-following only when the current refspec does not explicitly
map the tag to a destination. This also avoids pre-filling the refname
buffer before an exact refspec transform appends its destination.

Cover exact and wildcard destinations, forced updates of an existing
tag, and preservation of an existing tag during ordinary auto-following.

Fixes: libgit2#7438
Assisted-by: Codex:GPT-6
Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>

This branch has not been deployed

No deployments
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.

Explicit refspec for a tag is ignored with GIT_REMOTE_DOWNLOAD_TAGS_AUTO (refs/tags/v1:refs/custom/x never updated)

1 participant