Skip to content

Commit 4af0c75

Browse files
authored
Merge pull request #5 from codedx/bugfix/case-insensitive-branch-name
Handle branch name filter case-insensitively
2 parents cf41382 + 58434a1 commit 4af0c75

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/client.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,13 @@ impl ApiClient {
330330
}
331331

332332
pub fn query_branches_for_project(&self, project_id: u32, branch_name: &str) -> ApiResult<Vec<ApiBranch>> {
333-
self.get_branches_for_project(project_id).map(
334-
|branches| branches.into_iter().filter(|branch| branch.name.contains(branch_name)).collect()
335-
)
333+
let branch_name_lowercase = branch_name.to_lowercase();
334+
self.get_branches_for_project(project_id).map(|branches| {
335+
branches
336+
.into_iter()
337+
.filter(|branch| branch.name.to_lowercase().contains(&branch_name_lowercase))
338+
.collect()
339+
})
336340
}
337341

338342
pub fn start_analysis(&self, project_context: ProjectContext, branch_name: Option<String>, files: Vec<&Path>) -> ApiResult<ApiAnalysisJobResponse> {

0 commit comments

Comments
 (0)