Repository navigation
[repo-assist] Fix local git dependency version restriction failure (#3422) - #4390
Merged
dsyme merged 1 commit intoAug 29, 2026
Conversation
Closes #3422 Root cause: RemoteDownload.getSHA1OfBranch handled the LocalGitOrigin case with only NoVersionRestriction and Concrete branch names; any VersionRequirement (e.g. 'git file:///path/to/repo >= 1.0') fell through to failwith "unexpected version restriction". The RemoteGitOrigin case already supported VersionRequirement by scanning git tags for a matching version, so this mirrors that logic for local repositories using the local path directly instead of a remote cache clone. Co-authored-by: Copilot <[email protected]>
dsyme
marked this pull request as ready for review
August 29, 2026 09:35
17 tasks
This was referenced Oct 5, 2026
This was referenced Oct 14, 2026
This was referenced Nov 11, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #3422
Root cause
RemoteDownload.getSHA1OfBranchhandles resolving a commit hash forgitdependencies. For local git repos (git (redacted) it only handledVersionRestriction.NoVersionRestrictionandVersionRestriction.Concrete(a literal branch/tag name). Any version-range requirement (e.g.git (redacted) >= 1.0, matching the documented syntax) parses toVersionRestriction.VersionRequirement`, which fell through to:producing the reported
Paket failed with -> unexpected version restriction.The
RemoteGitOrigin(non-local) branch of the same match already supportsVersionRequirementby fetching a cache clone and searching git tags for the highest matching version. This PR mirrors that same logic forLocalGitOrigin, operating directly on the local path (no cache clone needed since the repo is already on disk).Fix
src/Paket.Core/Dependencies/RemoteDownload.fs: forLocalGitOrigin, when the version restriction is aVersionRequirement, list tags viagit tag, parse them asSemVer, filter by the requirement range, and resolve the hash of the highest matching tag — the same approach already used for remote git origins.Trade-offs
NoVersionRestriction/Concrete(branch name) cases.Git.CommandHelper.runFullGitCommand/Git.Handling.getHashhelpers already used for the remote case, for consistency.Test Status
dotnet build src/Paket.Core/Paket.Core.fsproj, net461 + netstandard2.0).dotnet test tests/Paket.Tests/Paket.Tests.fsproj --filter "FullyQualifiedName~Git"— 36/36 passed on net9 (net461 host skipped in this sandbox: nomonoavailable to run the net461 test host).Add this agentic workflow to your repo
To install this agentic workflow, run