@@ -2393,7 +2393,7 @@ extension Workspace {
2393
2393
) throws -> [ ( PackageReference , PackageStateChange ) ] {
2394
2394
// Load pins store and managed dependendencies.
2395
2395
let pinsStore = try self . pinsStore. load ( )
2396
- var packageStateChanges : [ String : ( PackageReference , PackageStateChange ) ] = [ : ]
2396
+ var packageStateChanges : [ PackageIdentity : ( PackageReference , PackageStateChange ) ] = [ : ]
2397
2397
2398
2398
// Set the states from resolved dependencies results.
2399
2399
for (packageRef, binding, products) in resolvedDependencies {
@@ -2416,7 +2416,7 @@ extension Workspace {
2416
2416
} ) {
2417
2417
currentDependency = editedDependency
2418
2418
let originalReference = editedDependency. basedOn!. packageRef // forced unwrap safe
2419
- packageStateChanges [ originalReference. location ] = ( originalReference, . unchanged)
2419
+ packageStateChanges [ originalReference. identity ] = ( originalReference, . unchanged)
2420
2420
} else {
2421
2421
currentDependency = nil
2422
2422
}
@@ -2435,14 +2435,14 @@ extension Workspace {
2435
2435
if let currentDependency = currentDependency {
2436
2436
switch currentDependency. state {
2437
2437
case . local, . edited:
2438
- packageStateChanges [ packageRef. location ] = ( packageRef, . unchanged)
2438
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . unchanged)
2439
2439
case . checkout:
2440
2440
let newState = PackageStateChange . State ( requirement: . unversioned, products: products)
2441
- packageStateChanges [ packageRef. location ] = ( packageRef, . updated( newState) )
2441
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . updated( newState) )
2442
2442
}
2443
2443
} else {
2444
2444
let newState = PackageStateChange . State ( requirement: . unversioned, products: products)
2445
- packageStateChanges [ packageRef. location ] = ( packageRef, . added( newState) )
2445
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . added( newState) )
2446
2446
}
2447
2447
2448
2448
case . revision( let identifier, let branch) :
@@ -2475,34 +2475,34 @@ extension Workspace {
2475
2475
newState = . revision( revision)
2476
2476
}
2477
2477
if case . checkout( let checkoutState) = currentDependency. state, checkoutState == newState {
2478
- packageStateChanges [ packageRef. location ] = ( packageRef, . unchanged)
2478
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . unchanged)
2479
2479
} else {
2480
2480
// Otherwise, we need to update this dependency to this revision.
2481
2481
let newState = PackageStateChange . State ( requirement: . revision( revision, branch: branch) , products: products)
2482
- packageStateChanges [ packageRef. location ] = ( packageRef, . updated( newState) )
2482
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . updated( newState) )
2483
2483
}
2484
2484
} else {
2485
2485
let newState = PackageStateChange . State ( requirement: . revision( revision, branch: branch) , products: products)
2486
- packageStateChanges [ packageRef. location ] = ( packageRef, . added( newState) )
2486
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . added( newState) )
2487
2487
}
2488
2488
2489
2489
case . version( let version) :
2490
2490
if let currentDependency = currentDependency {
2491
2491
if case . checkout( let checkoutState) = currentDependency. state, case . version( version, _) = checkoutState {
2492
- packageStateChanges [ packageRef. location ] = ( packageRef, . unchanged)
2492
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . unchanged)
2493
2493
} else {
2494
2494
let newState = PackageStateChange . State ( requirement: . version( version) , products: products)
2495
- packageStateChanges [ packageRef. location ] = ( packageRef, . updated( newState) )
2495
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . updated( newState) )
2496
2496
}
2497
2497
} else {
2498
2498
let newState = PackageStateChange . State ( requirement: . version( version) , products: products)
2499
- packageStateChanges [ packageRef. location ] = ( packageRef, . added( newState) )
2499
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . added( newState) )
2500
2500
}
2501
2501
}
2502
2502
}
2503
2503
// Set the state of any old package that might have been removed.
2504
- for packageRef in state. dependencies. lazy. map ( { $0. packageRef } ) where packageStateChanges [ packageRef. location ] == nil {
2505
- packageStateChanges [ packageRef. location ] = ( packageRef, . removed)
2504
+ for packageRef in state. dependencies. lazy. map ( { $0. packageRef } ) where packageStateChanges [ packageRef. identity ] == nil {
2505
+ packageStateChanges [ packageRef. identity ] = ( packageRef, . removed)
2506
2506
}
2507
2507
2508
2508
return Array ( packageStateChanges. values)
0 commit comments