Skip to content

Commit 9d95859

Browse files
committed
SourceControl: make some of the private API more public
This extends the visibility of some of the private implementation to the package level to allow use for testing without `@testable` imports.
1 parent ca47f73 commit 9d95859

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Sources/SourceControl/GitRepository.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,10 @@ extension GitFileSystemView: @unchecked Sendable {}
11641164
package struct GitShellError: Error, CustomStringConvertible {
11651165
let result: AsyncProcessResult
11661166

1167+
package init(result: AsyncProcessResult) {
1168+
self.result = result
1169+
}
1170+
11671171
public var description: String {
11681172
let stdout = (try? self.result.utf8Output()) ?? ""
11691173
let stderr = (try? self.result.utf8stderrOutput()) ?? ""

Sources/SourceControl/RepositoryManager.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ extension RepositoryManager {
541541
public let fromCache: Bool
542542
/// Indicates whether the repository was already present in the cache and updated or if a clean fetch was performed.
543543
public let updatedCache: Bool
544+
545+
package init(fromCache: Bool, updatedCache: Bool) {
546+
self.fromCache = fromCache
547+
self.updatedCache = updatedCache
548+
}
544549
}
545550
}
546551

@@ -609,7 +614,7 @@ extension RepositoryManager.RepositoryHandle: CustomStringConvertible {
609614

610615
extension RepositorySpecifier {
611616
// relative path where the repository should be stored
612-
internal func storagePath() throws -> Basics.RelativePath {
617+
package func storagePath() throws -> Basics.RelativePath {
613618
return try RelativePath(validating: self.fileSystemIdentifier)
614619
}
615620

0 commit comments

Comments
 (0)