Skip to content

Commit 3a465ca

Browse files
committed
fix(OrtResultTest): Avoid setting resolvedRevision after the fact
Signed-off-by: Jens Keim <[email protected]>
1 parent c4a3301 commit 3a465ca

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

model/src/test/kotlin/OrtResultTest.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,12 @@ class OrtResultTest : WordSpec({
162162

163163
"getDefinitionFilePathRelativeToAnalyzerRoot()" should {
164164
"use the correct vcs" {
165-
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "")
166-
val provenance = RepositoryProvenance(vcsInfo = vcs, resolvedRevision = HashAlgorithm.SHA1.emptyValue)
165+
val vcs = VcsInfo(
166+
type = VcsType.GIT,
167+
url = "https://example.com/git",
168+
revision = HashAlgorithm.SHA1.emptyValue
169+
)
170+
val provenance = RepositoryProvenance(vcsInfo = vcs, resolvedRevision = vcs.revision)
167171
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "")
168172
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "")
169173
val project1 = Project.EMPTY.copy(
@@ -203,8 +207,12 @@ class OrtResultTest : WordSpec({
203207
}
204208

205209
"fail if no vcs matches" {
206-
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "")
207-
val provenance = RepositoryProvenance(vcsInfo = vcs, resolvedRevision = HashAlgorithm.SHA1.emptyValue)
210+
val vcs = VcsInfo(
211+
type = VcsType.GIT,
212+
url = "https://example.com/git",
213+
revision = HashAlgorithm.SHA1.emptyValue
214+
)
215+
val provenance = RepositoryProvenance(vcsInfo = vcs, resolvedRevision = vcs.revision)
208216
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "")
209217
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "")
210218
val project = Project.EMPTY.copy(

0 commit comments

Comments
 (0)