@@ -1112,7 +1112,7 @@ extension Workspace {
1112
1112
1113
1113
// Remove the existing checkout.
1114
1114
do {
1115
- let oldCheckoutPath = self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
1115
+ let oldCheckoutPath = self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
1116
1116
try fileSystem. chmod ( . userWritable, path: oldCheckoutPath, options: [ . recursive, . onlyFiles] )
1117
1117
try fileSystem. removeFileTree ( oldCheckoutPath)
1118
1118
}
@@ -1150,7 +1150,7 @@ extension Workspace {
1150
1150
}
1151
1151
1152
1152
// Form the edit working repo path.
1153
- let path = self . location. editsDirectory . appending ( dependency. subpath )
1153
+ let path = self . location. editsSubdirectory ( for : dependency. packageRef )
1154
1154
// Check for uncommited and unpushed changes if force removal is off.
1155
1155
if !forceRemove {
1156
1156
let workingCopy = try repositoryManager. openWorkingCopy ( at: path)
@@ -1440,9 +1440,9 @@ extension Workspace {
1440
1440
public func path( to dependency: Workspace . ManagedDependency ) -> AbsolutePath {
1441
1441
switch dependency. state {
1442
1442
case . checkout:
1443
- return self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
1443
+ return self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
1444
1444
case . edited( _, let path) :
1445
- return path ?? self . location. editsDirectory . appending ( dependency. subpath )
1445
+ return path ?? self . location. editsSubdirectory ( for : dependency. packageRef )
1446
1446
case . local:
1447
1447
return AbsolutePath ( dependency. packageRef. location)
1448
1448
}
@@ -2676,7 +2676,7 @@ extension Workspace {
2676
2676
// If we already have it, fetch to update the repo from its remote.
2677
2677
// also compare the location as it may have changed
2678
2678
if let dependency = self . state. dependencies [ comparingLocation: package ] {
2679
- let path = self . location. repositoriesCheckoutsDirectory . appending ( dependency. subpath )
2679
+ let path = self . location. repositoriesCheckoutSubdirectory ( for : dependency. packageRef )
2680
2680
2681
2681
// Make sure the directory is not missing (we will have to clone again
2682
2682
// if not).
@@ -2844,7 +2844,7 @@ extension Workspace {
2844
2844
}
2845
2845
2846
2846
// Remove the checkout.
2847
- let dependencyPath = self . location. repositoriesCheckoutsDirectory . appending ( dependencyToRemove. subpath )
2847
+ let dependencyPath = self . location. repositoriesCheckoutSubdirectory ( for : dependencyToRemove. packageRef )
2848
2848
let workingCopy = try repositoryManager. openWorkingCopy ( at: dependencyPath)
2849
2849
guard !workingCopy. hasUncommittedChanges ( ) else {
2850
2850
throw WorkspaceDiagnostics . UncommitedChanges ( repositoryPath: dependencyPath)
0 commit comments