aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/repository_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-26 01:04:43 +0900
committernsfisis <nsfisis@gmail.com>2026-06-26 01:04:43 +0900
commit36ee45a9aaa5c13ce3e7f7abcce4374e25536224 (patch)
treeb7ef834886dd3be7000d06ecdfe4ae4c73cc25fe /crates/shirabe/src/command/repository_command.rs
parentf639066eaf49325fdbf1b697fb24c187b2d5038e (diff)
downloadphp-shirabe-36ee45a9aaa5c13ce3e7f7abcce4374e25536224.tar.gz
php-shirabe-36ee45a9aaa5c13ce3e7f7abcce4374e25536224.tar.zst
php-shirabe-36ee45a9aaa5c13ce3e7f7abcce4374e25536224.zip
fix(repository-command,config): delimited Preg pattern and list-form repos
RepositoryCommand's JSON-arg detection used the un-delimited regex r"^\s*\{"; the PHP source is the delimited '{^\s*\{}', which compile_php_pattern requires. Config::merge only extracted repositories from PhpMixed::Array; a JSON array decodes to PhpMixed::List (an array with integer keys in PHP) and was silently dropped. Handle List by mapping to integer string keys. Un-ignores all 10 remaining RepositoryCommandTest cases (16/16 pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/repository_command.rs')
-rw-r--r--crates/shirabe/src/command/repository_command.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/shirabe/src/command/repository_command.rs b/crates/shirabe/src/command/repository_command.rs
index 4cbe08c..c8d99a5 100644
--- a/crates/shirabe/src/command/repository_command.rs
+++ b/crates/shirabe/src/command/repository_command.rs
@@ -296,7 +296,7 @@ impl Command for RepositoryCommand {
}));
}
let arg1_str = arg1.as_deref().unwrap();
- let repo_config: PhpMixed = if Preg::is_match(r"^\s*\{", arg1_str) {
+ let repo_config: PhpMixed = if Preg::is_match(r"{^\s*\{}", arg1_str) {
JsonFile::parse_json(Some(arg1_str), None)?
} else {
if arg2.is_none() {