Skip to content

Commit 331e5e5

Browse files
Merge branch 'main' into bkellam/ask-share-links-SOU-65
2 parents f4b61d6 + dd98025 commit 331e5e5

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Changed chat permissions model from read-only flag to ownership-based access control. [#888](https://github.com/sourcebot-dev/sourcebot/pull/888)
1717
- Improved anonymous chat experience: anonymous users can now create chats and claim them upon signing in. [#888](https://github.com/sourcebot-dev/sourcebot/pull/888)
1818

19+
### Fixed
20+
- Fixed issue where local repos with URL-encoded spaces in remote URLs would fail to load tree preview and index correctly. [#899](https://github.com/sourcebot-dev/sourcebot/pull/899)
21+
22+
1923
## [4.10.30] - 2026-02-12
2024

2125
### Added

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ So you're interested in contributing to Sourcebot. Great! If you have any questi
44

55
## Understanding the Licenses
66

7-
First thing to know is that Sourcebot is not a side-project - it is a product of a company based in San Francisco who build and maintain it professionally. For this reason, Sourcebot follows the [open core](https://en.wikipedia.org/wiki/Open-core_model) business model, which splits the codebase into two parts: **core** and **ee**, which each have their own license:
7+
First thing to know is that Sourcebot is not a side-project - it is a product of a company based in San Francisco who builds and maintain it professionally. For this reason, Sourcebot follows the [open core](https://en.wikipedia.org/wiki/Open-core_model) business model, which splits the codebase into two parts: **core** and **ee**, which each have their own license:
88

99
- **core** code is licensed under the [Functional Source License](https://fsl.software/), a
1010
mostly permissive non-compete license that converts to Apache 2.0 or MIT after two years. Code shipped in core (without ee) forms the [Sourcebot Community Edition (CE)](https://www.sourcebot.dev/pricing).
@@ -25,7 +25,7 @@ We want to make it easy to contribute to Sourcebot. Here are the most common typ
2525
- Additional LLM providers
2626
- Documentation improvements
2727

28-
However, any UI or core proudct feature must go through a design review with the core team before implementation. If you're unsure if your PR would be accepted, ask a maintainer.
28+
However, any UI or core product feature must go through a design review with the core team before implementation. If you're unsure if your PR would be accepted, ask a maintainer.
2929

3030
> [!NOTE]
3131
> PRs that ignore these guardrails will likely be closed.

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ zoekt:
1414
export CTAGS_COMMANDS=ctags
1515

1616
clean:
17-
redis-cli FLUSHALL
17+
@if docker ps 2>/dev/null | grep -q sourcebot-redis; then \
18+
echo "Flushing Redis in Docker container..."; \
19+
docker exec sourcebot-redis redis-cli FLUSHALL; \
20+
else \
21+
echo "Flushing local Redis..."; \
22+
redis-cli FLUSHALL; \
23+
fi
1824
yarn dev:prisma:migrate:reset
1925

2026
rm -rf \
@@ -36,7 +42,13 @@ clean:
3642

3743
soft-reset:
3844
rm -rf .sourcebot
39-
redis-cli FLUSHALL
45+
@if docker ps 2>/dev/null | grep -q sourcebot-redis; then \
46+
echo "Flushing Redis in Docker container..."; \
47+
docker exec sourcebot-redis redis-cli FLUSHALL; \
48+
else \
49+
echo "Flushing local Redis..."; \
50+
redis-cli FLUSHALL; \
51+
fi
4052
yarn dev:prisma:migrate:reset
4153

4254

packages/backend/src/repoCompileUtils.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,26 @@ describe('compileGenericGitHostConfig_file', () => {
143143
expect(result.warnings[0]).toContain('/path/to/invalid/repo');
144144
expect(result.warnings[0]).toContain('not a git repository');
145145
});
146+
147+
test('should decode URL-encoded characters in origin url pathname', async () => {
148+
mockedGlob.mockResolvedValue(['/path/to/repo-with-spaces']);
149+
mockedIsPathAValidGitRepoRoot.mockResolvedValue(true);
150+
// URL with %20 (encoded space) in the pathname
151+
mockedGetOriginUrl.mockResolvedValue('https://github.com/test/Project%20Name%20With%20Spaces.git');
152+
153+
const config = {
154+
type: 'git' as const,
155+
url: 'file:///path/to/repo-with-spaces',
156+
};
157+
158+
const result = await compileGenericGitHostConfig_file(config, 1);
159+
160+
expect(result.repoData).toHaveLength(1);
161+
expect(result.warnings).toHaveLength(0);
162+
// The repo name should have decoded spaces, not %20
163+
expect(result.repoData[0].name).toBe('github.com/test/Project Name With Spaces');
164+
expect(result.repoData[0].displayName).toBe('github.com/test/Project Name With Spaces');
165+
});
146166
});
147167

148168
describe('compileGenericGitHostConfig_url', () => {

packages/backend/src/repoCompileUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ export const compileGenericGitHostConfig_file = async (
586586
// the host:port directly from the raw URL to match zoekt's behavior.
587587
// For non-HTTP URLs, remoteUrl.host preserves non-default ports (e.g., ssh://host:22/).
588588
const hostWithPort = extractHostWithPort(origin) ?? remoteUrl.host;
589-
const repoName = path.join(hostWithPort, remoteUrl.pathname.replace(/\.git$/, ''));
589+
// Decode URL-encoded characters (e.g., %20 -> space) to ensure consistent repo names
590+
const decodedPathname = decodeURIComponent(remoteUrl.pathname);
591+
const repoName = path.join(hostWithPort, decodedPathname.replace(/\.git$/, ''));
590592

591593
const repo: RepoData = {
592594
external_codeHostType: 'genericGitHost',

0 commit comments

Comments
 (0)