Skip to content

Commit 402d794

Browse files
committed
Rollback createWorkingCopy async change
1 parent 6632a91 commit 402d794

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Sources/SourceControl/GitRepository.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public struct GitRepositoryProvider: RepositoryProvider, Cancellable {
229229
sourcePath: Basics.AbsolutePath,
230230
at destinationPath: Basics.AbsolutePath,
231231
editable: Bool
232-
) async throws -> WorkingCheckout {
232+
) throws -> WorkingCheckout {
233233
if editable {
234234
// For editable clones, i.e. the user is expected to directly work on them, first we create
235235
// a clone from our cache of repositories and then we replace the remote to the one originally

Sources/SourceControl/Repository.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public protocol RepositoryProvider: Cancellable {
121121
repository: RepositorySpecifier,
122122
sourcePath: AbsolutePath,
123123
at destinationPath: AbsolutePath,
124-
editable: Bool) async throws -> WorkingCheckout
124+
editable: Bool) throws -> WorkingCheckout
125125

126126
/// Returns true if a working repository exists at `path`
127127
func workingCopyExists(at path: AbsolutePath) throws -> Bool

Sources/SourceControl/RepositoryManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ public class RepositoryManager: Cancellable {
433433
_ handle: RepositoryHandle,
434434
at destinationPath: Basics.AbsolutePath,
435435
editable: Bool
436-
) async throws -> WorkingCheckout {
437-
try await self.provider.createWorkingCopy(
436+
) throws -> WorkingCheckout {
437+
try self.provider.createWorkingCopy(
438438
repository: handle.repository,
439439
sourcePath: self.path.appending(handle.subpath),
440440
at: destinationPath,
@@ -549,7 +549,7 @@ extension RepositoryManager {
549549
///
550550
/// - editable: The clone is expected to be edited by user.
551551
public func createWorkingCopy(at path: Basics.AbsolutePath, editable: Bool) async throws -> WorkingCheckout {
552-
return try await self.manager.createWorkingCopy(self, at: path, editable: editable)
552+
return try self.manager.createWorkingCopy(self, at: path, editable: editable)
553553
}
554554
}
555555
}

Sources/_InternalTestSupport/InMemoryGitRepository.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public final class InMemoryGitRepositoryProvider: RepositoryProvider {
458458
sourcePath: AbsolutePath,
459459
at destinationPath: AbsolutePath,
460460
editable: Bool
461-
) async throws -> WorkingCheckout {
461+
) throws -> WorkingCheckout {
462462
guard let checkout = fetchedMap[sourcePath] else {
463463
throw InternalError("unknown checkout at \(sourcePath)")
464464
}

Tests/SourceControlTests/RepositoryManagerTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ final class RepositoryManagerTests: XCTestCase {
533533
fatalError("should not be called")
534534
}
535535

536-
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) async throws -> WorkingCheckout {
536+
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) throws -> WorkingCheckout {
537537
fatalError("should not be called")
538538
}
539539

@@ -607,7 +607,7 @@ final class RepositoryManagerTests: XCTestCase {
607607
return MockRepository()
608608
}
609609

610-
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) async throws -> WorkingCheckout {
610+
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) throws -> WorkingCheckout {
611611
fatalError("should not be called")
612612
}
613613

@@ -763,10 +763,10 @@ private class DummyRepositoryProvider: RepositoryProvider {
763763
return DummyRepository(provider: self)
764764
}
765765

766-
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) async throws -> WorkingCheckout {
766+
func createWorkingCopy(repository: RepositorySpecifier, sourcePath: AbsolutePath, at destinationPath: AbsolutePath, editable: Bool) throws -> WorkingCheckout {
767767
try self.fileSystem.createDirectory(destinationPath)
768768
try self.fileSystem.writeFileContents(destinationPath.appending("README.txt"), bytes: "Hi")
769-
return try await self.openWorkingCopy(at: destinationPath)
769+
return DummyWorkingCheckout(at: destinationPath)
770770
}
771771

772772
func workingCopyExists(at path: AbsolutePath) throws -> Bool {

0 commit comments

Comments
 (0)