Skip to content

Commit 7dd1cc5

Browse files
committed
Review
1 parent 8b6d5ea commit 7dd1cc5

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

crates/uv-workspace/src/workspace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,10 @@ impl Workspace {
907907
// For the cases such as `MemberDiscovery::None`, add the current project if missing.
908908
if let Some(root_member) = current_project {
909909
if !workspace_members.contains_key(&root_member.project.name) {
910-
assert_eq!(options.members, MemberDiscovery::None);
910+
assert!(matches!(
911+
options.members,
912+
MemberDiscovery::None | MemberDiscovery::Ignore(_)
913+
));
911914
debug!(
912915
"Adding current workspace member: `{}`",
913916
root_member.root.simplified_display()

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,9 @@ impl AddTarget {
13641364
};
13651365
let lock = target.read_bytes().await?;
13661366

1367-
// Clone the target.
1367+
// Obtain a detached a copy of the old structure so we can revert to it without
1368+
// breaking the assumption that the workspace cache is only used by the modifying code
1369+
// when changing it.
13681370
match self {
13691371
Self::Script(script, _) => Ok(AddTargetSnapshot::Script(script.clone(), lock)),
13701372
Self::Project(project, _) => {

0 commit comments

Comments
 (0)