aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crates/shirabe/src/command/fund_command.rs19
-rw-r--r--crates/shirabe/src/console/application.rs7
2 files changed, 12 insertions, 14 deletions
diff --git a/crates/shirabe/src/command/fund_command.rs b/crates/shirabe/src/command/fund_command.rs
index 9511cc31..349decf9 100644
--- a/crates/shirabe/src/command/fund_command.rs
+++ b/crates/shirabe/src/command/fund_command.rs
@@ -135,16 +135,14 @@ impl Command for FundCommand {
// collect funding data from default branches
for (_, package) in &result.packages {
- if package.as_alias().is_none() {
- // TODO: check for CompleteAliasPackage as well
- if let Some(complete_pkg) = package.as_complete()
- && complete_pkg.is_default_branch()
- && !complete_pkg.get_funding().is_empty()
- && packages_to_load_names.contains(&complete_pkg.get_name())
- {
- Self::insert_funding_data(&mut fundings, &complete_pkg)?;
- packages_to_load_names.shift_remove(&complete_pkg.get_name());
- }
+ if package.as_alias().is_none()
+ && let Some(complete_pkg) = package.as_complete()
+ && complete_pkg.is_default_branch()
+ && !complete_pkg.get_funding().is_empty()
+ && packages_to_load_names.contains(&complete_pkg.get_name())
+ {
+ Self::insert_funding_data(&mut fundings, &complete_pkg)?;
+ packages_to_load_names.shift_remove(&complete_pkg.get_name());
}
}
@@ -154,7 +152,6 @@ impl Command for FundCommand {
{
continue;
}
- // TODO: check for CompleteAliasPackage as well
if let Some(complete_pkg) = package.as_complete()
&& !complete_pkg.get_funding().is_empty()
{
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index b4d98054..24aee249 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -1012,12 +1012,13 @@ impl Application {
let commands_snapshot: Vec<std::rc::Rc<std::cell::RefCell<dyn SymfonyCommand>>> =
self.commands.values().cloned().collect();
for command in &commands_snapshot {
+ // TODO(port): Symfony registers the aliases of every command here, while this pass
+ // skips any command that cannot be borrowed.
// A command's run() can re-enter find() (e.g. HelpCommand looks up the command it
// describes). That command is mutably borrowed for the duration of its run(), so it
- // cannot be borrowed here. It is safe to skip: find() always completes this alias pass
- // before returning a command, so any command currently executing already had its
+ // cannot be borrowed here. Skipping it is safe: find() always completes this alias
+ // pass before returning a command, so any command currently executing already had its
// aliases registered in the earlier find() call that located it.
- // TODO: this work-around could be solved.
let Ok(borrowed) = command.try_borrow() else {
continue;
};