From 8181f57ec3428195ac822590257cb3c135e25b5d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 3 Jun 2026 23:42:06 +0900 Subject: feat(downloader): return Result from getUnpushedChanges to bubble RuntimeException Match PHP GitDownloader::getUnpushedChanges, which returns ?string while throwing \RuntimeException on git command failure. Change the signature to Result> and replace the three panic\!() sites with Err(RuntimeException), mirroring the get_local_changes port. Thread ? through the clean_changes and StatusCommand call sites. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/downloader/dvcs_downloader_interface.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/downloader/dvcs_downloader_interface.rs') diff --git a/crates/shirabe/src/downloader/dvcs_downloader_interface.rs b/crates/shirabe/src/downloader/dvcs_downloader_interface.rs index 4c8ebd3..59f5774 100644 --- a/crates/shirabe/src/downloader/dvcs_downloader_interface.rs +++ b/crates/shirabe/src/downloader/dvcs_downloader_interface.rs @@ -1,8 +1,13 @@ //! ref: composer/src/Composer/Downloader/DvcsDownloaderInterface.php +use anyhow::Result; + use crate::package::PackageInterfaceHandle; pub trait DvcsDownloaderInterface { - fn get_unpushed_changes(&self, package: PackageInterfaceHandle, path: String) - -> Option; + fn get_unpushed_changes( + &self, + package: PackageInterfaceHandle, + path: String, + ) -> Result>; } -- cgit v1.3.1