Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit f2a6cf8

Browse files
committed
Fix code search on local repos (#1204)
* Fix code search on local repos We were making semantic queries with the full stringified repo ref. Instead, we should have been constructing a semantic query using the repository display name. It seems that this was fixed coincidentally in #1190 via a condition (which might now be possible to remove). * Use indexed name in semantic query construction
1 parent 9591707 commit f2a6cf8

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

server/bleep/src/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl Agent {
432432
target: Some(query),
433433
repos: repos
434434
.iter()
435-
.map(RepoRef::to_string)
435+
.map(RepoRef::indexed_name)
436436
.map(|r| parser::Literal::Plain(r.into()))
437437
.collect(),
438438
paths,

server/bleep/src/semantic.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,7 @@ fn build_conditions(
808808
let repo_filter = {
809809
let conditions = query
810810
.repos()
811-
.map(|r| {
812-
if r.contains('/') && !r.starts_with("github.com/") {
813-
format!("github.com/{r}")
814-
} else {
815-
r.to_string()
816-
}
817-
})
818-
.map(|r| make_kv_keyword_filter("repo_name", r.as_ref()).into())
811+
.map(|r| make_kv_keyword_filter("repo_name", &r).into())
819812
.collect::<Vec<_>>();
820813
// one of the above repos should match
821814
if conditions.is_empty() {

0 commit comments

Comments
 (0)