From b7c3981fd60662cdf500aaf1a7e49a77b967968d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 15:23:13 +0900 Subject: fix(comparer): return instead of exiting the process on doTree failure Composer's doCompare() calls `exit;` when the destination doTree fails, but the source branch handles the identical failure with `return;`. The asymmetry has been present since the class was first written (2413b55c6, 2018) and is almost certainly a bug. Treat it as `return` so a failed local-change detection no longer terminates the whole process. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/package/comparer/comparer.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src') diff --git a/crates/shirabe/src/package/comparer/comparer.rs b/crates/shirabe/src/package/comparer/comparer.rs index d23e669..3139295 100644 --- a/crates/shirabe/src/package/comparer/comparer.rs +++ b/crates/shirabe/src/package/comparer/comparer.rs @@ -79,7 +79,10 @@ impl Comparer { shirabe_php_shim::chdir(¤t_directory); shirabe_php_shim::chdir(&self.update); if !Self::do_tree(".", &mut destination) { - std::process::exit(0); + // PHP calls `exit` here, but this is almost certainly a bug. The source branch above + // handles the same failure with `return`, and there is no reason for the destination + // branch to terminate the whole process. We treat it as `return`. + return; } shirabe_php_shim::chdir(¤t_directory); for (dir, value) in &source { -- cgit v1.3.1