Base number of commits off of the branch

This commit is contained in:
Webber 2020-05-02 15:43:21 +02:00 committed by Webber Takken
parent 34e4b86924
commit 5328bda08e
2 changed files with 4 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -195,9 +195,11 @@ export default class Versioning {
/**
* Get the total number of commits on head.
*
* Note: HEAD should not be used, as it may be detached, resulting in an additional count.
*/
static async getTotalNumberOfCommits() {
const numberOfCommitsAsString = await System.run('git', ['rev-list', '--count', 'HEAD']);
const numberOfCommitsAsString = await System.run('git', ['rev-list', '--count', this.branch]);
return Number.parseInt(numberOfCommitsAsString, 10);
}