File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -89,23 +89,27 @@ private class RepositoryDeserializer : StdDeserializer<Repository>(Repository::c
8989 override fun deserialize (p : JsonParser , ctxt : DeserializationContext ): Repository {
9090 val node = p.codec.readTree<JsonNode >(p)
9191 val parsedProvenance = when {
92- // Parse [vcs] attribute and create a Repository
9392 node.has(" vcs" ) -> {
93+ // Parse [vcs] and [vcsProcessed] attributes
9494 val vcsInfo = jsonMapper.treeToValue<VcsInfo >(node[" vcs" ])
9595 val vcsProcess = jsonMapper.treeToValue<VcsInfo >(node[" vcs_processed" ])
9696
97+ // Get the [vcs]'s revision
9798 val resolvedRevision = if (vcsInfo.revision != " " ) {
9899 vcsInfo.revision
99100 } else if (vcsProcess.revision != " " ) {
101+ // Fall back to [vcsProcessed], if [vcs] has empty revision
100102 vcsProcess.revision
101103 } else {
102104 HashAlgorithm .SHA1 .emptyValue
103105 }
104106
107+ // Build a RepositoryProvenance from the parsed VcsInfo fields
105108 RepositoryProvenance (vcsInfo, resolvedRevision)
106109 }
107110
108111 else -> {
112+ // Parse the [provenance], if no legacy fields are present
109113 jsonMapper.treeToValue<RepositoryProvenance >(node[" provenance" ])
110114 }
111115 }
You can’t perform that action at this time.
0 commit comments