Skip to content

Commit

Permalink
fix(scheduler): Canonicalize git URL in SourceFile rather than tantiv…
Browse files Browse the repository at this point in the history
…y index (#1839)

* fix(scheduler): Canonicalize git URL in SourceFile rather than tantivy index

* Use canonical_git_url
  • Loading branch information
boxbeam authored Apr 12, 2024
1 parent 6472fe4 commit 2fa6c97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/tabby-scheduler/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl RepositoryExt for RepositoryConfig {
match read_to_string(entry.path()) {
Ok(file_content) => {
let source_file = SourceFile {
git_url: self.git_url.clone(),
git_url: self.canonical_git_url(),
basedir: dir.display().to_string(),
filepath: relative_path.display().to_string(),
max_line_length: metrics::max_line_length(&file_content),
Expand Down
2 changes: 1 addition & 1 deletion crates/tabby-scheduler/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn index_repositories(_config: &[RepositoryConfig]) -> Result<()> {

for doc in from_source_file(file) {
writer.add_document(doc!(
code.field_git_url => RepositoryConfig::canonicalize_url(&doc.git_url),
code.field_git_url => doc.git_url,
code.field_filepath => doc.filepath,
code.field_language => doc.language,
code.field_name => doc.name,
Expand Down

0 comments on commit 2fa6c97

Please sign in to comment.