Compare commits

...

2 Commits

Author SHA1 Message Date
Webber 44bde7feb9 Base number of commits off of the branch on origin 2020-05-02 16:37:24 +02:00
Webber 5328bda08e Base number of commits off of the branch 2020-05-02 16:37:24 +02:00
2 changed files with 8 additions and 2 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -195,9 +195,15 @@ export default class Versioning {
/** /**
* Get the total number of commits on head. * 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() { static async getTotalNumberOfCommits() {
const numberOfCommitsAsString = await System.run('git', ['rev-list', '--count', 'HEAD']); const numberOfCommitsAsString = await System.run('git', [
'rev-list',
'--count',
`origin/${this.branch}`,
]);
return Number.parseInt(numberOfCommitsAsString, 10); return Number.parseInt(numberOfCommitsAsString, 10);
} }