Repository navigation
Description
Problem
verify_origin() reads git remote get-url origin and compares the result directly with the dependency URL from vex.ws. Git expands url.<base>.insteadOf in remote get-url, so this compares an effective transport URL against a declared source URL.
A checkout can therefore have the correct stored remote.origin.url and exact locked commit but still be rejected as having the wrong origin. The diagnostic recommends removing the checkout even though cloning it again with the same configuration does not address the mismatch.
Code reference: src/resolver.rs — verify_origin, ensure_repository, require_local_repository, and require_checkout_at.
Git documents URL expansion in git remote get-url.
Reproduction scenario
Use temporary repositories and an isolated Git configuration rather than changing the developer's global configuration:
- Create a local Git library package named
depwithvex.wsandsrc/lib.wave. - Add an
insteadOfrule mapping the exact declared URLhttps://vex-fixture.invalid/dep.gitto that repository's localfile:URL. - Create an application with
{ name = "dep", git = "https://vex-fixture.invalid/dep.git" }in its dependencies and runvex fetchunder that configuration. - Inspect the managed checkout:
git config --get remote.origin.urlretains the declared URL, whilegit remote get-url originreturns the rewritten local URL. - Repeat
vex fetch --locked --offline, or use a dry-run path that callsrequire_checkout_at. The current origin comparison rejects the mismatch between those two representations.
The fixture requires no external network access because Git rewrites the declared URL to a local repository.
Expected behavior
Preserve declared source identity separately from Git's effective transport URL. Validate the configured origin against the declared dependency without disabling ordinary user URL rewriting or removing origin validation.
Acceptance criteria
- Compare the stored origin source declaration, not the
insteadOf-expanded transport URL, with the manifest/lockfile identity. - Continue rejecting a genuinely changed origin and handle missing or ambiguous origin configuration explicitly.
- Keep the declared URL in
vex.lock; do not persist machine-specific rewritten transport URLs. - Add local-Git integration coverage for first fetch, repeated reuse,
--locked --offline, and the dry-run checkout verification path. - Verify that normal dependencies without rewrite rules retain existing behavior.
- Keep credentials, SSH configuration, proxy settings, and Git URL rewriting available to clone/fetch; do not solve this by clearing all user Git configuration.
- Run tests with isolated HOME/config paths and
cargo test --locked.
Source aliases, broad URL canonicalization, and changing locked commit selection are outside this issue.
Activity