fix: honor --pin when --force is specified on extension install#13602
Open
AruneshDwivedi wants to merge 1 commit into
Open
fix: honor --pin when --force is specified on extension install#13602AruneshDwivedi wants to merge 1 commit into
AruneshDwivedi wants to merge 1 commit into
Conversation
When --pin and --force are both set on an already-installed extension, remove the existing extension first and fall through to the install path with the pin, instead of taking the upgrade path which ignores the pin and installs latest. Fixes cli#13551
|
Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review. Note: We still encourage linking to an issue with the |
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.
Problem
gh extension install OWNER/REPO --pin <tag> --forceignores the pin when the extension is already installed. The --force flag routes to the upgrade path, which installs latest instead of the pinned version.Root Cause
In command.go, when an existing extension is found and --force is set, the code calls upgradeFunc regardless of whether --pin was also provided. The upgrade path doesn't honor the pin for binary extensions.
Fix
When both --pin and --force are set, remove the existing extension first and fall through to the install path with the pin flag, ensuring the specified version is installed.
Testing
Reproduction steps from the issue now correctly install the pinned version instead of latest.
Fixes #13551