diff --git a/ee/tabby-schema/src/schema/mod.rs b/ee/tabby-schema/src/schema/mod.rs index 5f6296dc7102..fa8c95ab95bb 100644 --- a/ee/tabby-schema/src/schema/mod.rs +++ b/ee/tabby-schema/src/schema/mod.rs @@ -545,19 +545,24 @@ impl Query { let user = check_user_and_auth_token(ctx, true).await?; let context_info = ctx.locator.context().read(Some(&user.policy)).await?; - let target_source_id: Option = context_info.helper().allowed_code_repository().closest_match(&git_url).map(String::from); - let repos = ctx.locator + let target_source_id: Option = context_info + .helper() + .allowed_code_repository() + .closest_match(&git_url) + .map(String::from); + let repos = ctx + .locator .repository() .repository_list(Some(&user.policy)) .await?; - + // Iterate through repositories and find matching source_id let matching_repo = repos.iter().find(|repo| { // Match repo source_id with your target Some(&repo.source_id) == target_source_id.as_ref() }); - Ok(matching_repo.map(|repo| repo.clone())) + Ok(matching_repo.cloned()) } async fn context_info(ctx: &Context) -> Result {