diff --git a/packages/core/src/__tests__/git.test.ts b/packages/core/src/__tests__/git.test.ts index 980dcc983..5fd0b9950 100644 --- a/packages/core/src/__tests__/git.test.ts +++ b/packages/core/src/__tests__/git.test.ts @@ -127,14 +127,6 @@ describe("github", () => { }); describe("getTagNotInBaseBranch", () => { - test("works with no tags, defaults to first commit", async () => { - const gh = new Git(options); - gh.getTags = () => Promise.resolve([]); - expect(await gh.getTagNotInBaseBranch("branch")).toBe( - "0b2af75d8b55c8869cda93d0e5589ad9f2677e18" - ); - }); - test("finds greatest tag not in base branch", async () => { const gh = new Git(options); diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts index 0bf7b72c7..c68e4f05b 100644 --- a/packages/core/src/auto.ts +++ b/packages/core/src/auto.ts @@ -1243,7 +1243,9 @@ export default class Auto { const initialForkCommit = (forkPoints[forkPoints.length - 1] || "").slice(1); const lastRelease = initialForkCommit || (await this.git.getLatestRelease()); - const lastTag = await this.git.getLastTagNotInBaseBranch(currentBranch!); + const lastTag = + (await this.git.getLastTagNotInBaseBranch(currentBranch!)) || + (await this.git.getFirstCommit()); const fullReleaseNotes = await this.release.generateReleaseNotes( lastRelease ); diff --git a/packages/core/src/git.ts b/packages/core/src/git.ts index 522488216..1d897623a 100644 --- a/packages/core/src/git.ts +++ b/packages/core/src/git.ts @@ -870,10 +870,10 @@ export default class Git { this.logger.verbose.info("Tags found in branch:", branchTags); this.logger.verbose.info( `${options.first ? "First" : "Latest"} tag in branch:`, - firstGreatestUnique + firstGreatestUnique || "Not Found" ); - return firstGreatestUnique || this.getFirstCommit(); + return firstGreatestUnique; } /** Get the last tag that isn't in the base branch */