diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-06 13:23:46 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-06 13:23:46 +0900 |
| commit | 9d7983455c051185f44a507c2f4e9b8a33f1799d (patch) | |
| tree | ac58517b30b41f5f790dfe5c564ae74544569fa2 /crates/shirabe/src/downloader/svn_downloader.rs | |
| parent | 4bf226dd30743505707d2ad4e322d49d4258dae0 (diff) | |
| download | php-shirabe-9d7983455c051185f44a507c2f4e9b8a33f1799d.tar.gz php-shirabe-9d7983455c051185f44a507c2f4e9b8a33f1799d.tar.zst php-shirabe-9d7983455c051185f44a507c2f4e9b8a33f1799d.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/svn_downloader.rs')
| -rw-r--r-- | crates/shirabe/src/downloader/svn_downloader.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/shirabe/src/downloader/svn_downloader.rs b/crates/shirabe/src/downloader/svn_downloader.rs index ef0fd16..95f25f8 100644 --- a/crates/shirabe/src/downloader/svn_downloader.rs +++ b/crates/shirabe/src/downloader/svn_downloader.rs @@ -84,6 +84,24 @@ impl SvnDownloader { Ok(None) } + + /// The default `VcsDownloader::clean_changes()` behavior: fail if the working copy has + /// local changes. + fn fail_on_local_changes( + &mut self, + package: PackageInterfaceHandle, + path: &str, + ) -> anyhow::Result<()> { + if self.get_local_changes(package, path)?.is_some() { + return Err(RuntimeException { + message: format!("Source directory {} has uncommitted changes.", path), + code: 0, + } + .into()); + } + + Ok(()) + } } impl VcsDownloader for SvnDownloader { @@ -257,7 +275,8 @@ impl VcsDownloader for SvnDownloader { return self.discard_changes(path).await; } - return self.inner.clean_changes(package, path, update).await; + self.fail_on_local_changes(package, path)?; + return Ok(None); } let changes_str = changes.unwrap(); |
