Skip to content

Commit 0288b8f

Browse files
fviernausschuberth
authored andcommitted
feat(cocoapods): Improve extracting the VCS info
If the VCS info in checkout options is incomplete, fallback to the VCS info from the podspec instead of using a (partially) empty VCS info. Signed-off-by: Frank Viernau <[email protected]>
1 parent 00cb532 commit 0288b8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ private fun Podspec.toVcsInfo(): VcsInfo? =
182182
)
183183
}
184184

185-
private fun Lockfile.CheckoutOption.toVcsInfo(): VcsInfo {
186-
val revision = commit ?: tag ?: branch.orEmpty()
187-
val url = git.orEmpty()
185+
private fun Lockfile.CheckoutOption.toVcsInfo(): VcsInfo? {
186+
val revision = commit ?: tag ?: branch ?: return null
187+
val url = git ?: return null
188188
return VcsInfo(VcsType.GIT, url, revision)
189189
}

0 commit comments

Comments
 (0)