-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When looking for a branch with a given name, we might fail to find it if the branch is not on the first page. The default page size seems to be 100, so if there is more than 100 branches, it becomes more an more likely that we don't find the branch we are looking for.
Lines 166 to 190 in c33aa38
| CommitSelector::BranchName { branch_name } => { | |
| debug!("searching for branch by the name {branch_name:?}"); | |
| let url = browser.absolute_url(format!("projects/{project_id}/branches")); | |
| let branches: Vec<Branch> = browser.http_get(url).await?.json().await?; | |
| trace!("found the following branches:\n{branches:#?}"); | |
| let matching_branches: Vec<&Branch> = branches | |
| .iter() | |
| .filter(|p| p.name.starts_with(branch_name)) | |
| .collect(); | |
| if matching_branches.is_empty() { | |
| error!("no branch matched the specified name {branch_name:?}"); | |
| info!("the following branch where found:\n{branches:#?}"); | |
| bail!("error finding any matching branch"); | |
| } else if matching_branches.len() > 1 { | |
| error!("multiple branches matched the specified name {branch_name:?}, please be more specific"); | |
| info!("the following branches where found:\n{matching_branches:#?}"); | |
| bail!("error finding exactly one matching branch"); | |
| } | |
| matching_branches.first().unwrap().head.id.to_owned() | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working