Skip to content

Commit 8118c07

Browse files
committed
fix: restore original sorting behavior while keeping first-level directory guarantee
1 parent 07610dc commit 8118c07

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/services/glob/list-files.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ function isDirectoryExplicitlyIgnored(dirName: string): boolean {
402402
return false
403403
}
404404

405-
406405
/**
407406
* Combine file and directory results and format them properly
408407
*/
@@ -416,16 +415,6 @@ function formatAndCombineResults(files: string[], directories: string[], limit:
416415

417416
// Sort to ensure directories come first, followed by files
418417
uniquePaths.sort((a: string, b: string) => {
419-
// Remove trailing slash for depth calculation
420-
const aPath = a.endsWith("/") ? a.slice(0, -1) : a
421-
const bPath = b.endsWith("/") ? b.slice(0, -1) : b
422-
const aDepth = aPath.split("/").length
423-
const bDepth = bPath.split("/").length
424-
425-
if (aDepth !== bDepth) {
426-
return aDepth - bDepth
427-
}
428-
429418
const aIsDir = a.endsWith("/")
430419
const bIsDir = b.endsWith("/")
431420

0 commit comments

Comments
 (0)