isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

fix: determine if the branch exists first #1173

Closed dcshzj closed 7 months ago

dcshzj commented 7 months ago

Problem

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

Bug Fixes:

Tests

Deploy Notes

None