Skip to content

Commit e0de69c

Browse files
fix: 添加对SVN目录的排除并改进错误处理
- 在文件搜索和检查点服务中排除.svn目录 - 改进SVN工具中的错误处理,确保错误信息正确显示
1 parent d6fcee2 commit e0de69c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/services/checkpoints/excludes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ const getLfsPatterns = async (workspacePath: string) => {
200200

201201
export const getExcludePatterns = async (workspacePath: string) => [
202202
".git/",
203+
".svn/",
203204
...getBuildArtifactPatterns(),
204205
...getMediaFilePatterns(),
205206
...getCacheFilePatterns(),

src/services/search/file-search.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export async function executeRipgrepForFiles(
9898
"-g",
9999
"!**/.git/**",
100100
"-g",
101+
"!**/.svn/**",
102+
"-g",
101103
"!**/out/**",
102104
"-g",
103105
"!**/dist/**",

src/utils/svn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export async function getSvnWorkingState(cwd: string): Promise<{
479479
additionalInfo += `\n--- ${file} (${stats.isFile() ? "file" : "directory"}) ---\n`
480480
}
481481
} catch (error) {
482-
additionalInfo += `\n--- ${file} (unable to read: ${error.message}) ---\n`
482+
additionalInfo += `\n--- ${file} (unable to read: ${error instanceof Error ? error.message : String(error)}) ---\n`
483483
}
484484
}
485485

@@ -601,6 +601,6 @@ export async function getSvnCommitInfoForMentions(revision: string, cwd: string)
601601
return commitInfo
602602
} catch (error) {
603603
console.error("[DEBUG] Error getting SVN commit info for mentions:", error)
604-
return `Error fetching SVN commit r${revision}: ${error.message}`
604+
return `Error fetching SVN commit r${revision}: ${error instanceof Error ? error.message : String(error)}`
605605
}
606606
}

0 commit comments

Comments
 (0)