diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 4bd3fc639e1bc6e518f567443c9a9b867d661171..3dafd524c794335b81aa7d3167995bdd254172fb 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -192,6 +192,9 @@ export async function syncGit(): Promise<void> { logger.debug({ durationMs }, 'git fetch completed'); clone = false; } catch (err) /* istanbul ignore next */ { + if (err.message === REPOSITORY_EMPTY) { + throw err; + } logger.error({ err }, 'git fetch error'); } } @@ -213,6 +216,9 @@ export async function syncGit(): Promise<void> { if (err.message?.includes('No space left on device')) { throw new Error(SYSTEM_INSUFFICIENT_DISK_SPACE); } + if (err.message === REPOSITORY_EMPTY) { + throw err; + } throw new ExternalHostError(err, 'git'); } const durationMs = Math.round(Date.now() - cloneStart);