Renovate: Bitbucket gitFs: Renovate shouldnt fail on empty repos

Created on 15 Nov 2018  Â·  5Comments  Â·  Source: renovatebot/renovate

What Renovate type are you using?
Renovate CLI

Describe the bug

Renovate will fail when running on a repo without a commit history

Did you see anything helpful in debug logs?

ref refs/remotes/origin/HEAD is not a symbolic ref\n",
         "stack": "Error: fatal: ref refs/remotes/origin/HEAD is not a symbolic ref\n\n    at /Users/jackla/src/renovate/node_modules/simple-git/promise.js:21:26\n    at Git.<anonymous> (/Users/jackla/src/renovate/node_modules/simple-git/src/git.js:645:18)\n    at Function.Git.fail (/Users/jackla/src/renovate/node_modules/simple-git/src/git.js:1478:18)\n    at fail (/Users/jackla/src/renovate/node_modules/simple-git/src/git.js:1436:20)\n    at /Users/jackla/src/renovate/node_modules/simple-git/src/git.js:1445:16\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)"
       }

To Reproduce
Steps to reproduce the behavior:

  • create an empty repo on Bitbucket
  • Run Renovate --autodiscover
  • Renovate will fail with error ref refs/remotes/origin/HEAD is not a symbolic ref

Expected behavior

  • Renovate should simply fail fast and move on to the next repo

Screenshots
n/a

Additional context
We noticed this while developing BB Server support, but decided to raise it as a separate issue which can be addressed for all platforms at once.

bitbucket priority-4-low bug

All 5 comments

note to self: this is easily fixed by throwing a specific error in initRepo in storage.js, and catching it in repository/error.js

I fixed this in GitLab by looking at its initRepo result. Similar solution was already in GitHub so it exits before any git. If for BB we can’t detect it early via API then we’ll need to catch it then throw an ‘empty’ error, which is handled gracefully.

Ie throw new Error(‘empty’)

le throw
—French developers

:tada: This issue has been resolved in version 14.42.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings