From 9d7983455c051185f44a507c2f4e9b8a33f1799d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 13:23:46 +0900 Subject: fix(vcs-downloader): abort on local changes in parent cleanChanges path The VcsDownloaderBase::clean_changes stub returned Ok(None), silently swallowing the abort that PHP's parent::cleanChanges() raises when the working copy has uncommitted changes. Drop the stub and give Git/Svn a private fail_on_local_changes helper that performs the getLocalChanges check and throws, matching the default VcsDownloader::clean_changes(). Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/downloader/vcs_downloader.rs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'crates/shirabe/src/downloader/vcs_downloader.rs') diff --git a/crates/shirabe/src/downloader/vcs_downloader.rs b/crates/shirabe/src/downloader/vcs_downloader.rs index 0637f08..a967c3b 100644 --- a/crates/shirabe/src/downloader/vcs_downloader.rs +++ b/crates/shirabe/src/downloader/vcs_downloader.rs @@ -55,21 +55,6 @@ impl VcsDownloaderBase { } } - /// Equivalent of PHP `parent::cleanChanges()`. Subclasses that override the trait method - /// call this when they need to invoke the base behavior. Since this lives on the data struct, - /// it cannot consult subclass-specific `get_local_changes`; it assumes any callers have - /// already verified that no local changes exist. - pub async fn clean_changes( - &self, - _package: PackageInterfaceHandle, - _path: &str, - _update: bool, - ) -> Result> { - // TODO(phase-b): parent::cleanChanges() rechecks getLocalChanges via dynamic dispatch. - // Callers in subclasses must do that check themselves (they already have). - Ok(None) - } - pub fn get_vcs_reference(&self, package: PackageInterfaceHandle, path: &str) -> Option { let parser = VersionParser::new(); let mut guesser = VersionGuesser::new( -- cgit v1.3.1