Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed Ask GitHub landing page chat box placement to be centered on the page instead of at the bottom. [#1046](https://github.com/sourcebot-dev/sourcebot/pull/1046)
- Fixed issue where local git connections (`file://`) would fail when matching a file instead of a directory. [#1049](https://github.com/sourcebot-dev/sourcebot/pull/1049)

## [4.16.2] - 2026-03-25

Expand Down
9 changes: 9 additions & 0 deletions packages/backend/src/repoCompileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createLogger } from '@sourcebot/shared';
import { BitbucketConnectionConfig, GerritConnectionConfig, GiteaConnectionConfig, GitlabConnectionConfig, GenericGitHostConnectionConfig, AzureDevOpsConnectionConfig } from '@sourcebot/schemas/v3/connection.type';
import { ProjectVisibility } from "azure-devops-node-api/interfaces/CoreInterfaces.js";
import path from 'path';
import fs from 'fs/promises';
import { glob } from 'glob';
import { getLocalDefaultBranch, getOriginUrl, isPathAValidGitRepoRoot, isUrlAValidGitRepo } from './git.js';
import assert from 'assert';
Expand Down Expand Up @@ -611,6 +612,14 @@ export const compileGenericGitHostConfig_file = async (
logger.info(`Found ${repoPaths.length} path(s) matching pattern '${configUrl.pathname}'`);

await Promise.all(repoPaths.map((repoPath) => gitOperationLimit(async () => {
const stat = await fs.stat(repoPath).catch(() => null);
if (!stat || !stat.isDirectory()) {
const warning = `Skipping ${repoPath} - path is not a directory.`;
logger.warn(warning);
warnings.push(warning);
return;
}

const isGitRepo = await isPathAValidGitRepoRoot({
path: repoPath,
});
Expand Down
Loading