diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b040bd..ab382ac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,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) ## [4.10.8] - 2026-01-13 diff --git a/packages/backend/src/git.ts b/packages/backend/src/git.ts index 948b1f3b..89977001 100644 --- a/packages/backend/src/git.ts +++ b/packages/backend/src/git.ts @@ -1,4 +1,4 @@ -import { env } from "@sourcebot/shared"; +import { env, createLogger } from "@sourcebot/shared"; import { existsSync } from 'node:fs'; import { mkdir } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; @@ -6,6 +6,8 @@ import { CheckRepoActions, GitConfigScope, simpleGit, SimpleGitProgressEvent } f type onProgressFn = (event: SimpleGitProgressEvent) => void; +const logger = createLogger('git-utils'); + /** * Creates a simple-git client that has it's working directory * set to the given path. @@ -292,7 +294,7 @@ export const getCommitHashForRefName = async ({ // @note: Was hitting errors when the repository is empty, // so we're catching the error and returning undefined. } catch (error: unknown) { - console.error(error); + logger.debug(error); return undefined; } } \ No newline at end of file