优化文件树git状态检测性能

This commit is contained in:
xintaofei
2026-03-20 22:46:17 +08:00
parent 1ce062dce4
commit aeddc37655
3 changed files with 35 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ function normalizePathSegments(path: string): string[] {
}
function normalizeGitStatusPath(path: string): string {
const normalized = path.trim()
const normalized = path.trim().replace(/\/+$/, "")
const renameSeparator = " -> "
const renameIndex = normalized.lastIndexOf(renameSeparator)
if (renameIndex < 0) return normalized