Skip to content

Commit 52c852b

Browse files
authored
Replace deprecated url with a more useful one (#3837)
Many clients of libSwiftPM will want to deal with Foundation URLs here, so it makes sense to offer a computed property to convert a `RepositorySpecifier` location into that.
1 parent a368b64 commit 52c852b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Sources/SourceControl/Repository.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public struct RepositorySpecifier: Hashable {
2929
self.init(location: .url(url))
3030
}
3131

32-
/// The URL of the repository.
33-
// FIXME: transition url to location
34-
@available(*, deprecated, message: "user location instead")
35-
public var url: String {
36-
self.location.description
32+
/// The location of the repository as URL.
33+
public var url: URL {
34+
switch self.location {
35+
case .path(let path): return URL(fileURLWithPath: path.pathString)
36+
case .url(let url): return url
37+
}
3738
}
3839

3940
/// A unique identifier for this specifier.

0 commit comments

Comments
 (0)