Skip to content

Commit

Permalink
refactor(repository): remove unused resolve_source_id_by_git_url meth…
Browse files Browse the repository at this point in the history
…od (#3570)
  • Loading branch information
wsxiaoys authored Dec 17, 2024
1 parent 81de67b commit 78e9866
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions ee/tabby-schema/src/schema/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,4 @@ pub trait RepositoryService: Send + Sync {
fn third_party(&self) -> Arc<dyn ThirdPartyRepositoryService>;

async fn list_all_code_repository(&self) -> Result<Vec<CodeRepository>>;

async fn resolve_source_id_by_git_url(&self, git_url: &str) -> Result<String>;
}
15 changes: 0 additions & 15 deletions ee/tabby-webserver/src/service/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,6 @@ impl RepositoryService for RepositoryServiceImpl {

Ok(ret)
}

async fn resolve_source_id_by_git_url(&self, git_url: &str) -> Result<String> {
let git_url = RepositoryConfig::canonicalize_url(git_url);

// Only third_party repositories with a git_url could generates a web source (e.g Issues, PRs)
let tp = self.third_party();
let repos = tp
.list_repositories_with_filter(None, None, Some(true), None, None, None, None)
.await?;
repos
.iter()
.find(|r| RepositoryConfig::canonicalize_url(&r.git_url) == git_url)
.map(|r| r.source_id())
.ok_or_else(|| anyhow::anyhow!("No web source found for git_url: {}", git_url).into())
}
}

fn to_grep_file(file: tabby_git::GrepFile) -> tabby_schema::repository::GrepFile {
Expand Down

0 comments on commit 78e9866

Please sign in to comment.