@@ -1111,7 +1111,7 @@ extension Workspace {
1111
1111
1112
1112
// Remove the existing checkout.
1113
1113
do {
1114
- let oldCheckoutPath = self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
1114
+ let oldCheckoutPath = self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
1115
1115
try fileSystem. chmod ( . userWritable, path: oldCheckoutPath, options: [ . recursive, . onlyFiles] )
1116
1116
try fileSystem. removeFileTree ( oldCheckoutPath)
1117
1117
}
@@ -1149,7 +1149,7 @@ extension Workspace {
1149
1149
}
1150
1150
1151
1151
// Form the edit working repo path.
1152
- let path = self . location. editsDirectory . appending ( dependency. subpath )
1152
+ let path = self . location. editsSubdirectory ( for : dependency. packageRef )
1153
1153
// Check for uncommited and unpushed changes if force removal is off.
1154
1154
if !forceRemove {
1155
1155
let workingCopy = try repositoryManager. openWorkingCopy ( at: path)
@@ -1432,9 +1432,9 @@ extension Workspace {
1432
1432
public func path( to dependency: Workspace . ManagedDependency ) -> AbsolutePath {
1433
1433
switch dependency. state {
1434
1434
case . checkout:
1435
- return self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
1435
+ return self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
1436
1436
case . edited( _, let path) :
1437
- return path ?? self . location. editsDirectory . appending ( dependency. subpath )
1437
+ return path ?? self . location. editsSubdirectory ( for : dependency. packageRef )
1438
1438
case . local:
1439
1439
return AbsolutePath ( dependency. packageRef. location)
1440
1440
}
@@ -2660,7 +2660,7 @@ extension Workspace {
2660
2660
private func fetch( package : PackageReference ) throws -> AbsolutePath {
2661
2661
// If we already have it, fetch to update the repo from its remote.
2662
2662
if let dependency = self . state. dependencies [ package ] {
2663
- let path = self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
2663
+ let path = self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
2664
2664
2665
2665
// Make sure the directory is not missing (we will have to clone again
2666
2666
// if not).
@@ -2840,7 +2840,7 @@ extension Workspace {
2840
2840
}
2841
2841
2842
2842
// Remove the checkout.
2843
- let dependencyPath = self . location. repositoriesCheckoutsDirectory . appending ( dependencyToRemove. subpath )
2843
+ let dependencyPath = self . location. repositoriesCheckoutSubdirectory ( for : dependencyToRemove. packageRef )
2844
2844
let workingCopy = try repositoryManager. openWorkingCopy ( at: dependencyPath)
2845
2845
guard !workingCopy. hasUncommittedChanges ( ) else {
2846
2846
throw WorkspaceDiagnostics . UncommitedChanges ( repositoryPath: dependencyPath)
0 commit comments