From 58434a121cb96cdb2c43de15f8c1ff48ba292efb Mon Sep 17 00:00:00 2001 From: Abe Rosloff <62895177+arosloffdx@users.noreply.github.com> Date: Mon, 11 Jul 2022 16:31:05 -0400 Subject: [PATCH] Handle branch name filter case-insensitively --- src/client.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index b8faf9f..6bd0bbd 100644 --- a/src/client.rs +++ b/src/client.rs @@ -330,9 +330,13 @@ impl ApiClient { } pub fn query_branches_for_project(&self, project_id: u32, branch_name: &str) -> ApiResult> { - self.get_branches_for_project(project_id).map( - |branches| branches.into_iter().filter(|branch| branch.name.contains(branch_name)).collect() - ) + let branch_name_lowercase = branch_name.to_lowercase(); + self.get_branches_for_project(project_id).map(|branches| { + branches + .into_iter() + .filter(|branch| branch.name.to_lowercase().contains(&branch_name_lowercase)) + .collect() + }) } pub fn start_analysis(&self, project_context: ProjectContext, branch_name: Option, files: Vec<&Path>) -> ApiResult {