Skip to content

Commit 3050e63

Browse files
committed
Merge branch 'arr4n/release-branch-checker' into arr4n/version-constant
2 parents 5b03082 + 649fdb9 commit 3050e63

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libevm/tooling/release/release_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func testReleaseBranch(t *testing.T, targetBranch string) {
186186

187187
closestCommonAncestors, err := head.MergeBase(main)
188188
require.NoError(t, err)
189-
require.Lenf(t, closestCommonAncestors, 1, `number of "best common ancestors" of HEAD (%v) and %q (%v)`, head.Hash, defaultBranch, main.Hash)
189+
require.Lenf(t, closestCommonAncestors, 1, `number of "closest common ancestors" of HEAD (%v) and %q (%v)`, head.Hash, defaultBranch, main.Hash)
190190
// Not to be confused with the GitHub concept of a (repo) fork.
191191
fork := closestCommonAncestors[0]
192192
t.Logf("Forked from %q at commit %v (%s)", defaultBranch, fork.Hash, commitMsgFirstLine(fork))
@@ -214,7 +214,12 @@ func testReleaseBranch(t *testing.T, targetBranch string) {
214214

215215
t.Run("final_commit", func(t *testing.T) {
216216
n := len(newCommits)
217-
last, penultimate := newCommits[n-1], newCommits[n-2]
217+
last := newCommits[n-1]
218+
penultimate := fork
219+
if n >= 2 {
220+
penultimate = newCommits[n-2]
221+
}
222+
218223
lastCommitDiffs, err := object.DiffTree(
219224
treeFromCommit(t, last),
220225
treeFromCommit(t, penultimate),

0 commit comments

Comments
 (0)