Skip to content

Commit ffd288f

Browse files
committed
Reverts
1 parent 4a34f0b commit ffd288f

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

crates/uv-distribution/src/metadata/lowering.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ fn git_source(
578578
) -> Result<RequirementSource, LoweringError> {
579579
let reference = match (rev, tag, branch) {
580580
(None, None, None) => GitReference::DefaultBranch,
581-
// TODO(charlie): Here, we should not assume that the revision is a commit.
582581
(Some(rev), None, None) => GitReference::from_rev(rev),
583582
(None, Some(tag), None) => GitReference::Tag(tag),
584583
(None, None, Some(branch)) => GitReference::Branch(branch),

crates/uv-git/src/git.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ impl GitRemote {
241241
locked_rev: Option<GitOid>,
242242
client: &ClientWithMiddleware,
243243
) -> Result<(GitDatabase, GitOid)> {
244-
// So, if we have FullCommit, then we should be assuming it's actually a commit. We don't
245-
// need to hit GitHub.
246244
let locked_ref = locked_rev.map(|oid| GitReference::FullCommit(oid.to_string()));
247245
let reference = locked_ref.as_ref().unwrap_or(reference);
248246
let enable_lfs_fetch = env::var(EnvVars::UV_GIT_LFS).is_ok();
@@ -765,7 +763,7 @@ fn github_fast_path(
765763
// If we know the reference is a full commit hash, we can just return it without
766764
// querying GitHub.
767765
return Ok(FastPathRev::NeedsFetch(rev));
768-
},
766+
}
769767
};
770768

771769
// TODO(charlie): If we _know_ that we have a full commit SHA, there's no need to perform this

crates/uv/src/commands/project/add.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,6 @@ fn augment_requirement(
898898
url,
899899
} => {
900900
let reference = if let Some(rev) = rev {
901-
// TODO(charlie): Here, it's probably okay for us to assume that the
902-
// rev is a commit.
903901
GitReference::from_rev(rev.to_string())
904902
} else if let Some(tag) = tag {
905903
GitReference::Tag(tag.to_string())
@@ -926,8 +924,6 @@ fn augment_requirement(
926924
url: match requirement.url.parsed_url {
927925
ParsedUrl::Git(mut git) => {
928926
let reference = if let Some(rev) = rev {
929-
// TODO(charlie): Here, it's probably okay for us to assume that the
930-
// rev is a commit.
931927
Some(GitReference::from_rev(rev.to_string()))
932928
} else if let Some(tag) = tag {
933929
Some(GitReference::Tag(tag.to_string()))

crates/uv/tests/it/branching_urls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ fn branching_urls_of_different_sources_disjoint() -> Result<()> {
667667
[package.metadata]
668668
requires-dist = [
669669
{ name = "iniconfig", marker = "python_full_version < '3.12'", url = "https://files.pythonhosted.org/packages/9b/dd/b3c12c6d707058fa947864b67f0c4e0c39ef8610988d7baea9578f3c48f3/iniconfig-1.1.1-py2.py3-none-any.whl" },
670-
{ name = "iniconfig", marker = "python_full_version >= '3.12'", git = "https://github.com/pytest-dev/iniconfig?rev=93f5930e668c0d1ddf4597e38dd0dea4e2665e7a#93f5930e668c0d1ddf4597e38dd0dea4e2665e7a" },
670+
{ name = "iniconfig", marker = "python_full_version >= '3.12'", git = "https://github.com/pytest-dev/iniconfig?rev=93f5930e668c0d1ddf4597e38dd0dea4e2665e7a" },
671671
]
672672
673673
[[package]]

crates/uv/tests/it/lock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ fn lock_sdist_git_subdirectory() -> Result<()> {
582582
]
583583

584584
[package.metadata]
585-
requires-dist = [{ name = "example-pkg-a", git = "https://github.com/pypa/sample-namespace-packages.git?subdirectory=pkg_resources%2Fpkg_a&rev=df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45" }]
585+
requires-dist = [{ name = "example-pkg-a", git = "https://github.com/pypa/sample-namespace-packages.git?subdirectory=pkg_resources%2Fpkg_a&rev=df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45" }]
586586
"###
587587
);
588588
});
@@ -742,7 +742,7 @@ fn lock_sdist_git_pep508() -> Result<()> {
742742
]
743743

744744
[package.metadata]
745-
requires-dist = [{ name = "uv-public-pypackage", git = "https://github.com/astral-test/uv-public-pypackage.git?rev=0dacfd662c64cb4ceb16e6cf65a157a8b715b979#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" }]
745+
requires-dist = [{ name = "uv-public-pypackage", git = "https://github.com/astral-test/uv-public-pypackage.git?rev=0dacfd662c64cb4ceb16e6cf65a157a8b715b979" }]
746746

747747
[[package]]
748748
name = "uv-public-pypackage"

crates/uv/tests/it/pip_install.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,11 +1745,15 @@ fn install_git_public_https_missing_commit() {
17451745
----- stderr -----
17461746
× Failed to download and build `uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b`
17471747
├─▶ Git operation failed
1748-
├─▶ failed to clone into: [CACHE_DIR]/git-v0/db/8dab139913c4b566
1749-
├─▶ failed to fetch commit `79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b`
1750-
╰─▶ process didn't exit successfully: `git fetch [...]` (exit code: 128)
1748+
├─▶ failed to find branch, tag, or commit `79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b`
1749+
╰─▶ process didn't exit successfully: `/usr/bin/git rev-parse '79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b^0'` (exit code: 128)
1750+
--- stdout
1751+
79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b^0
1752+
17511753
--- stderr
1752-
fatal: remote error: upload-pack: not our ref 79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b
1754+
fatal: ambiguous argument '79a935a7a1a0ad6d0bdf72dce0e16cb0a24a1b3b^0': unknown revision or path not in the working tree.
1755+
Use '--' to separate paths from revisions, like this:
1756+
'git <command> [<revision>...] -- [<file>...]'
17531757
"###);
17541758
}
17551759

0 commit comments

Comments
 (0)