From 693fff918b765cdd3d13f20a6c46fd8c4f35e12f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 10 Jan 2026 01:25:18 +0000 Subject: [PATCH 1/3] 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.md | 1 + packages/web/src/features/fileTree/api.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e6024e2c..a3c2fca9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Add warning logs when local repo index fails to match pattern. [#712](https://github.com/sourcebot-dev/sourcebot/pull/712) - Fixed issue with text direction issues with special characters in filter panel. [#474](https://github.com/sourcebot-dev/sourcebot/pull/474) +- Fixed issue where folders containing files with non-ASCII characters in their paths would appear duplicated in the file tree. ## [4.10.7] - 2025-12-29 diff --git a/packages/web/src/features/fileTree/api.ts b/packages/web/src/features/fileTree/api.ts index e5f34e89d..ed4c7aede 100644 --- a/packages/web/src/features/fileTree/api.ts +++ b/packages/web/src/features/fileTree/api.ts @@ -37,6 +37,8 @@ export const getTree = async (params: { repoName: string, revisionName: string } let result: string; try { result = await git.raw([ + // Disable quoting of non-ASCII characters in paths + '-c', 'core.quotePath=false', 'ls-tree', revisionName, // recursive @@ -117,6 +119,8 @@ export const getFolderContents = async (params: { repoName: string, revisionName let result: string; try { result = await git.raw([ + // Disable quoting of non-ASCII characters in paths + '-c', 'core.quotePath=false', 'ls-tree', revisionName, // format as output as {type},{path} @@ -166,6 +170,8 @@ export const getFiles = async (params: { repoName: string, revisionName: string let result: string; try { result = await git.raw([ + // Disable quoting of non-ASCII characters in paths + '-c', 'core.quotePath=false', 'ls-tree', revisionName, // recursive From 12e6c41b4db6eaabde4298f4f4f222631100c95e Mon Sep 17 00:00:00 2001 From: msukkari Date: Tue, 13 Jan 2026 16:15:01 -0800 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05ec8939..6855dd400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Add warning logs when local repo index fails to match pattern. [#712](https://github.com/sourcebot-dev/sourcebot/pull/712) - Fixed issue with text direction issues with special characters in filter panel. [#474](https://github.com/sourcebot-dev/sourcebot/pull/474) -- Fixed issue where folders containing files with non-ASCII characters in their paths would appear duplicated in the file tree. +- 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) ## [4.10.7] - 2025-12-29 From c474ff9c529df653d23d200b5f18d89e48d232e3 Mon Sep 17 00:00:00 2001 From: msukkari Date: Tue, 13 Jan 2026 16:15:29 -0800 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6855dd400..6ea946cd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - 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) - 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) +- 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) ## [4.10.8] - 2026-01-13 @@ -21,7 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Add warning logs when local repo index fails to match pattern. [#712](https://github.com/sourcebot-dev/sourcebot/pull/712) - Fixed issue with text direction issues with special characters in filter panel. [#474](https://github.com/sourcebot-dev/sourcebot/pull/474) -- 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) ## [4.10.7] - 2025-12-29