Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 12, 2024
1 parent d16b1bd commit b2c926d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ee/tabby-schema/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = context_info.helper().allowed_code_repository().closest_match(&git_url).map(String::from);
let repos = ctx.locator
let target_source_id: Option<String> = 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<ContextInfo> {
Expand Down

0 comments on commit b2c926d

Please sign in to comment.