diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-04 17:53:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-04 17:53:20 +0900 |
| commit | afe51053abd338e50fcc0fee3ba641721058da26 (patch) | |
| tree | 107faafd464123f0b38cc3bd31cb9287c741f05f /crates/shirabe/src/package/base_package.rs | |
| parent | 31f6ac69794361cdaee52cba0213a1b4da4932ac (diff) | |
| download | php-shirabe-afe51053abd338e50fcc0fee3ba641721058da26.tar.gz php-shirabe-afe51053abd338e50fcc0fee3ba641721058da26.tar.zst php-shirabe-afe51053abd338e50fcc0fee3ba641721058da26.zip | |
fix(package): reset repository/id on package clone
AnyPackage::dup() (PHP's `clone $package`) copied the `repository` and
`id` fields verbatim instead of resetting them like PHP's
BasePackage::__clone() does. LibraryInstaller::install() relies on the
duplicate being unbound so it can register the package with the local
repository; without the reset, add_package() silently failed with "A
package can only be added to one repository", leaving installed.json
empty after every install/create-project run.
Diffstat (limited to 'crates/shirabe/src/package/base_package.rs')
| -rw-r--r-- | crates/shirabe/src/package/base_package.rs | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/crates/shirabe/src/package/base_package.rs b/crates/shirabe/src/package/base_package.rs index 04b4ea0..44e4101 100644 --- a/crates/shirabe/src/package/base_package.rs +++ b/crates/shirabe/src/package/base_package.rs @@ -130,11 +130,6 @@ pub trait BasePackage: PackageInterface + std::fmt::Display { .get(self.get_stability()) .unwrap_or(&STABILITY_STABLE) } - - fn php_clone(&mut self) { - self.take_repository(); - *self.id_mut() = -1; - } } pub fn package_name_to_regexp(allow_pattern: &str) -> String { |
