mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Treat Git sources as immutable in lockfile (#6109)
## Summary We don't need to write metadata for Git sources, since we lock a specific SHA (and so the metadata is immutable).
This commit is contained in:
parent
29179570a1
commit
7dbed4bb2d
3 changed files with 31 additions and 121 deletions
|
@ -1808,8 +1808,10 @@ impl Source {
|
|||
///
|
||||
/// We assume that registry sources are immutable. In other words, we expect that once a
|
||||
/// package-version is published to a registry, its metadata will not change.
|
||||
///
|
||||
/// We also assume that Git sources are immutable, since a Git source encodes a specific commit.
|
||||
fn is_immutable(&self) -> bool {
|
||||
matches!(self, Self::Registry(..))
|
||||
matches!(self, Self::Registry(..) | Self::Git(_, _))
|
||||
}
|
||||
|
||||
fn to_toml(&self, table: &mut Table) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue