diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-20 15:23:13 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-20 15:23:59 +0900 |
| commit | b7c3981fd60662cdf500aaf1a7e49a77b967968d (patch) | |
| tree | f15079f31448cd882ade567eb7f9fade067b0277 /crates/shirabe | |
| parent | ac544bc3e1cb90cdcce4636654d0e266a78a2f85 (diff) | |
| download | php-shirabe-b7c3981fd60662cdf500aaf1a7e49a77b967968d.tar.gz php-shirabe-b7c3981fd60662cdf500aaf1a7e49a77b967968d.tar.zst php-shirabe-b7c3981fd60662cdf500aaf1a7e49a77b967968d.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
| -rw-r--r-- | crates/shirabe/src/package/comparer/comparer.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |
