From 8aae17870a5ec2fdd9f0d4d61d33c792ff7b62b0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 5 Jul 2026 18:09:25 +0900 Subject: fix(git-bitbucket-driver): match PHP exception/fallibility semantics for fallback paths VcsDriverInterface::get_source/get_dist were made fallible in the Rust port even though PHP's are infallible, forcing GitBitbucketDriver's fallback delegation to silently swallow errors via unwrap_or_default()/ok().flatten(). Make the trait infallible to match PHP, updating the mechanical Ok(...) wrapping in all implementors. Also narrow attempt_clone_fallback's cleanup to only trigger on RuntimeException, mirroring PHP's catch (\RuntimeException $e), using the same downcast pattern already used by has_composer_file for TransportException. --- crates/shirabe/src/repository/vcs/fossil_driver.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/repository/vcs/fossil_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs index 840a2ae..cf9a2ea 100644 --- a/crates/shirabe/src/repository/vcs/fossil_driver.rs +++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs @@ -402,12 +402,12 @@ impl crate::repository::vcs::VcsDriverInterface for FossilDriver { FossilDriver::get_tags(self) } - fn get_dist(&self, identifier: &str) -> anyhow::Result>> { - Ok(FossilDriver::get_dist(self, identifier)) + fn get_dist(&self, identifier: &str) -> Option> { + FossilDriver::get_dist(self, identifier) } - fn get_source(&self, identifier: &str) -> anyhow::Result> { - Ok(FossilDriver::get_source(self, identifier)) + fn get_source(&self, identifier: &str) -> IndexMap { + FossilDriver::get_source(self, identifier) } fn get_url(&self) -> String { -- cgit v1.3.1