Skip to content

Commit 6236c30

Browse files
CopilotByron
andcommitted
Address code review feedback: improve error message and add clarifying comment
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
1 parent 628261e commit 6236c30

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/but/src/forge/review.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ pub fn get_review_numbers(
537537

538538
/// Resolve a branch input string (which can be a CliId or branch name) to an actual branch name
539539
fn resolve_branch_name(ctx: &mut CommandContext, branch_input: &str) -> anyhow::Result<String> {
540-
// Try to resolve as a CliId first
540+
// CliId::from_str handles both exact branch names and CliId matches (including partial matches)
541541
let cli_ids = crate::id::CliId::from_str(ctx, branch_input)?;
542542

543543
if cli_ids.is_empty() {
@@ -566,9 +566,8 @@ fn resolve_branch_name(ctx: &mut CommandContext, branch_input: &str) -> anyhow::
566566
match &cli_ids[0] {
567567
crate::id::CliId::Branch { name } => Ok(name.clone()),
568568
other => anyhow::bail!(
569-
"Expected a branch, but '{}' resolved to {} which is {}",
569+
"Expected a branch, but '{}' resolved to {}",
570570
branch_input,
571-
other,
572571
other.kind()
573572
),
574573
}

0 commit comments

Comments
 (0)