Skip to content

Commit 1d4626d

Browse files
fix(worker): Change error logging on rev-parse to be debug (#733)
1 parent 488b9d1 commit 1d4626d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

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)
12+
- 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)
1213

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

packages/backend/src/git.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { env } from "@sourcebot/shared";
1+
import { env, createLogger } from "@sourcebot/shared";
22
import { existsSync } from 'node:fs';
33
import { mkdir } from 'node:fs/promises';
44
import { dirname, resolve } from 'node:path';
55
import { CheckRepoActions, GitConfigScope, simpleGit, SimpleGitProgressEvent } from 'simple-git';
66

77
type onProgressFn = (event: SimpleGitProgressEvent) => void;
88

9+
const logger = createLogger('git-utils');
10+
911
/**
1012
* Creates a simple-git client that has it's working directory
1113
* set to the given path.
@@ -292,7 +294,7 @@ export const getCommitHashForRefName = async ({
292294
// @note: Was hitting errors when the repository is empty,
293295
// so we're catching the error and returning undefined.
294296
} catch (error: unknown) {
295-
console.error(error);
297+
logger.debug(error);
296298
return undefined;
297299
}
298300
}

0 commit comments

Comments
 (0)