Skip to content

Commit a14f0c2

Browse files
Non-ascii file tree bug (#726)
* 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 * changelog * changelog --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 1d4626d commit a14f0c2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111
- Fixed issue where 403 errors were being raised during a user driven permission sync against a self-hosted code host. [#729](https://github.com/sourcebot-dev/sourcebot/pull/729)
1212
- Fixed "ambiguous argument 'HEAD^{commit}': unknown revision or path not in the working tree" error for blank repositories. [#733](https://github.com/sourcebot-dev/sourcebot/pull/733)
13+
- Fixed issue where folders containing files with non-ASCII characters in their paths would appear duplicated in the file tree. [#726](https://github.com/sourcebot-dev/sourcebot/pull/726)
1314

1415
## [4.10.8] - 2026-01-13
1516

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)