Repository navigation
fix: accept annotated tag object SHAs as git pins - #47
Merged
Merged
Conversation
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
…fter gc Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renovate's
git-tagsdatasource records the SHA of the tag object as the digest when a tag is annotated, not the SHA of the commit it points to. polylang-pro and woocommerce-subscriptions both have annotated tags, so a Renovate update in LibreSign/saas#39 can setrefto a tag object. The entrypoint from #45 checked that object out correctly but comparedHEADwith the tag object SHA, reported a mismatch and did not activate the plugin.Changes
refis a full SHA,HEADis compared with the commit it resolves to (ref^{commit}). For a commit SHA this is the same check as before. A tag object SHA is still immutable, since Git verifies the fetched object against its hash and the tag always resolves to the same commit. The check lives in one helper, used both before fetching and after checking out.refs/pinned. Without it, a tag object fetched by SHA was unreferenced: aftergit gcevery start fetched it again, and with the source unreachable the plugin was skipped.Tests
New cases in
tests/security/pinned-setup-sources.bats:git gc --prune=nowwith the source removed;All three fail on
main.bats tests/security: 65/65; ShellCheck clean.Also run against the real polylang-pro repository with
refset to thev3.7.3tag object (f5226a3):mainrefuses it, this branch checks out3ebf7d9and activates the plugin.