1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

fix(lockfile): don't touch lockfile is npm specifiers are identical (#17973)

We were unconditionally inserting npm specifiers into the lockfile,
marking it as "dirty" and requiring saving.
This commit is contained in:
Bartek Iwańczuk 2023-02-27 21:02:19 +01:00 committed by GitHub
parent 92ba46c384
commit c6c747873f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -297,12 +297,17 @@ Use \"--lock-write\" flag to regenerate the lockfile at \"{}\".",
serialized_package_req: String, serialized_package_req: String,
serialized_package_id: String, serialized_package_id: String,
) { ) {
let maybe_prev = self.content.npm.specifiers.get(&serialized_package_req);
if maybe_prev.is_none() || maybe_prev != Some(&serialized_package_id) {
self.has_content_changed = true;
}
self self
.content .content
.npm .npm
.specifiers .specifiers
.insert(serialized_package_req, serialized_package_id); .insert(serialized_package_req, serialized_package_id);
self.has_content_changed = true;
} }
} }