Skip to content

Commit a3864a3

Browse files
fix(core): canonicalize git_url before performing code search (TabbyML#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>
1 parent 510a63c commit a3864a3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Fixed and Improvements
2+
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.
3+
time: 2024-07-10T18:59:20.774068+09:00

crates/tabby/src/services/code.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl CodeSearchImpl {
8484
query.git_url, git_url
8585
);
8686

87-
query.git_url = git_url.to_owned();
87+
query.git_url = RepositoryConfig::canonicalize_url(git_url);
8888

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

0 commit comments

Comments
 (0)