Respect pip-like Git branch, tag, and commit references (#297)

We need to parse revisions out from URLs like `MyProject @
git+https://git.example.com/MyProject.git@v1.0`, per [VCS
Support](https://pip.pypa.io/en/stable/topics/vcs-support/). Cargo has
the advantage that it uses a TOML table in its configuration, so the
user has to specify whether they're fetching a commit, a tag, a branch,
etc. We have to instead assume that anything that isn't clearly a commit
is _either_ a branch or a tag.

Closes https://github.com/astral-sh/puffin/issues/296.
This commit is contained in:
Charlie Marsh 2023-11-02 12:10:02 -07:00 committed by GitHub
parent a4002fe132
commit e47d3f1f66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 370 additions and 29 deletions

View file

@ -9,8 +9,8 @@ use tracing::debug;
use puffin_cache::{digest, CanonicalUrl};
use crate::git::GitRemote;
use crate::{FetchStrategy, Git, GitReference};
use crate::git::{GitReference, GitRemote};
use crate::{FetchStrategy, Git};
/// A remote Git source that can be checked out locally.
pub struct GitSource {