Skip to content

Commit 22beb64

Browse files
committed
fix: correct current directory detection logic
The issue was that the condition checked for an empty string after normalization, but path.posix.normalize('') actually returns '.', not ''. This caused the current directory check to fail when an empty string was passed. Removed the redundant empty string check since normalize('') returns '.' which is already handled by the first condition.
1 parent b6bfdb6 commit 22beb64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/code-index/vector-store/qdrant-client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ export class QdrantVectorStore implements IVectorStore {
377377
if (directoryPrefix) {
378378
// Check if the path represents current directory
379379
const normalizedPrefix = path.posix.normalize(directoryPrefix.replace(/\\/g, "/"))
380-
if (normalizedPrefix === "." || normalizedPrefix === "./" || normalizedPrefix === "") {
380+
// Note: path.posix.normalize("") returns ".", and normalize("./") returns "./"
381+
if (normalizedPrefix === "." || normalizedPrefix === "./") {
381382
// Don't create a filter - search entire workspace
382383
filter = undefined
383384
} else {

0 commit comments

Comments
 (0)