Skip to content

Commit

Permalink
fix(core): canonicalize git_url before performing code search (TabbyM…
Browse files Browse the repository at this point in the history
…L#2612)

* fix(core): canonicalize git_url before performing code search

Previously, the git_url used in the index was not properly canonicalized, leading to inconsistencies when performing queries. This commit updates the code to ensure that the git_url is canonicalized before performing the code search.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
wsxiaoys and autofix-ci[bot] authored Jul 10, 2024
1 parent 510a63c commit a3864a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Fixed and Improvements
body: Canonicalize the git_url before performing a relevant code search. Previously, for git_urls with credentials, the canonicalized git_url was used in the index, but the query still used the raw git_url.
time: 2024-07-10T18:59:20.774068+09:00
2 changes: 1 addition & 1 deletion crates/tabby/src/services/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl CodeSearchImpl {
query.git_url, git_url
);

query.git_url = git_url.to_owned();
query.git_url = RepositoryConfig::canonicalize_url(git_url);

let docs_from_embedding = {
let embedding = self.embedding.embed(&query.content).await?;
Expand Down

0 comments on commit a3864a3

Please sign in to comment.