Skip to content

Commit

Permalink
Improve naming: pin -> makePinFromRevision()
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhts committed Oct 7, 2024
1 parent 1ee3410 commit 22f87d8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/ScipioKit/Producer/Cache/CacheSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ struct CacheSystem: Sendable {

private func retrievePin(package: ResolvedPackage) throws -> PinsStore.Pin {
#if compiler(>=6.0)
guard let pin = pinsStore.pins[package.identity] ?? package.pin else {
guard let pin = pinsStore.pins[package.identity] ?? package.makePinFromRevision() else {
throw Error.revisionNotDetected(package.manifest.displayName)
}
#elseif swift(>=5.10)
Expand Down Expand Up @@ -315,9 +315,8 @@ public struct VersionFileDecoder {

#if compiler(>=6.0)

fileprivate extension ResolvedPackage {

var pin: PinsStore.Pin? {
extension ResolvedPackage {
fileprivate func makePinFromRevision() -> PinsStore.Pin? {
let repository = GitRepository(path: path)

guard let tag = repository.getCurrentTag(), let version = Version(tag: tag) else {
Expand All @@ -337,7 +336,6 @@ fileprivate extension ResolvedPackage {
)
)
}

}

#endif

0 comments on commit 22f87d8

Please sign in to comment.