Skip to content

Commit 693fff9

Browse files
committed
fix: Prevent duplicate folders in file tree for non-ASCII paths
Git quotes paths containing non-ASCII characters using octal escape sequences (e.g., "src/\321\202\320\265\321\201\321\202.txt"). The previous code split on comma, leaving quotes in the path, which caused folders like "src" to appear twice (once as "src" and once as '"src'). Fixed by adding -c core.quotePath=false to all git ls-tree commands, which outputs paths without quoting, preventing duplicate folder entries. Fixes #SOU-74
1 parent 4ce474a commit 693fff9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Fixed
1616
- Add warning logs when local repo index fails to match pattern. [#712](https://github.com/sourcebot-dev/sourcebot/pull/712)
1717
- Fixed issue with text direction issues with special characters in filter panel. [#474](https://github.com/sourcebot-dev/sourcebot/pull/474)
18+
- Fixed issue where folders containing files with non-ASCII characters in their paths would appear duplicated in the file tree.
1819

1920
## [4.10.7] - 2025-12-29
2021

packages/web/src/features/fileTree/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export const getTree = async (params: { repoName: string, revisionName: string }
3737
let result: string;
3838
try {
3939
result = await git.raw([
40+
// Disable quoting of non-ASCII characters in paths
41+
'-c', 'core.quotePath=false',
4042
'ls-tree',
4143
revisionName,
4244
// recursive
@@ -117,6 +119,8 @@ export const getFolderContents = async (params: { repoName: string, revisionName
117119
let result: string;
118120
try {
119121
result = await git.raw([
122+
// Disable quoting of non-ASCII characters in paths
123+
'-c', 'core.quotePath=false',
120124
'ls-tree',
121125
revisionName,
122126
// format as output as {type},{path}
@@ -166,6 +170,8 @@ export const getFiles = async (params: { repoName: string, revisionName: string
166170
let result: string;
167171
try {
168172
result = await git.raw([
173+
// Disable quoting of non-ASCII characters in paths
174+
'-c', 'core.quotePath=false',
169175
'ls-tree',
170176
revisionName,
171177
// recursive

0 commit comments

Comments
 (0)