We get a lot of such errors when users access their site dashboard when retrieving the last saved and last published information:
Error when getting latest commit of "master" branch: Error: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
This happens because we try to get the Git log for the master branch first, before attempting on origin/master. The first one will fail as the master branch does not exist on EFS, but origin/master does.
Solution
Breaking Changes
[ ] Yes - this PR contains breaking changes
[x] No - this PR is backwards compatible with ALL of the following feature flags in this doc
Bug Fixes:
Determine if the branch exists first before continuing to get the Git log, so that we avoid encountering the error unnecessarily.
Tests
[ ] Navigate to any site dashboard.
[ ] Verify from the logs that there are no errors shown that matches the error log above.
[ ] Verify that you can see Unable to ascertain that "master" branch... log line as an info log.
Problem
We get a lot of such errors when users access their site dashboard when retrieving the last saved and last published information:
This happens because we try to get the Git log for the
master
branch first, before attempting onorigin/master
. The first one will fail as themaster
branch does not exist on EFS, butorigin/master
does.Solution
Breaking Changes
Bug Fixes:
Tests
Unable to ascertain that "master" branch...
log line as an info log.Deploy Notes
None