From 8de3932bda5d7ea58eeeda1a4909747b12274c57 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 17 Mar 2024 14:19:11 +0900 Subject: [PATCH] git-push: narrow search space of -rREVISIONS --- cli/src/commands/git.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/commands/git.rs b/cli/src/commands/git.rs index d5d2b7a0c..27c81b6d7 100644 --- a/cli/src/commands/git.rs +++ b/cli/src/commands/git.rs @@ -1188,8 +1188,8 @@ fn find_branches_targeted_by_revisions<'a>( workspace_command.evaluate_revset(current_branches_expression)?; current_branches_revset.iter().collect() } else { - // TODO: Narrow search space to local target commits. - let expression = workspace_command.parse_union_revsets(revisions)?; + let expression = workspace_command.parse_union_revsets(revisions)? + .intersection(&RevsetExpression::branches(StringPattern::everything())); let revset = workspace_command.evaluate_revset(expression)?; revset.iter().collect() };