@@ -15,12 +15,10 @@ use crate::core::registry::PackageRegistry;
1515use crate :: core:: resolver:: features:: {
1616 FeatureOpts , FeatureResolver , ForceAllTargets , ResolvedFeatures ,
1717} ;
18- use crate :: core:: resolver:: { self , HasDevUnits , Resolve , ResolveOpts , ResolveVersion } ;
18+ use crate :: core:: resolver:: { self , HasDevUnits , Resolve , ResolveOpts } ;
1919use crate :: core:: summary:: Summary ;
2020use crate :: core:: Feature ;
21- use crate :: core:: {
22- GitReference , PackageId , PackageIdSpec , PackageSet , Source , SourceId , Workspace ,
23- } ;
21+ use crate :: core:: { PackageId , PackageIdSpec , PackageSet , Source , SourceId , Workspace } ;
2422use crate :: ops;
2523use crate :: sources:: PathSource ;
2624use crate :: util:: errors:: { CargoResult , CargoResultExt } ;
@@ -601,31 +599,7 @@ fn register_previous_locks(
601599 . deps_not_replaced ( node)
602600 . map ( |p| p. 0 )
603601 . filter ( keep)
604- . collect :: < Vec < _ > > ( ) ;
605-
606- // In the v2 lockfile format and prior the `branch=master` dependency
607- // directive was serialized the same way as the no-branch-listed
608- // directive. Nowadays in Cargo, however, these two directives are
609- // considered distinct and are no longer represented the same way. To
610- // maintain compatibility with older lock files we register locked nodes
611- // for *both* the master branch and the default branch.
612- //
613- // Note that this is only applicable for loading older resolves now at
614- // this point. All new lock files are encoded as v3-or-later, so this is
615- // just compat for loading an old lock file successfully.
616- if resolve. version ( ) <= ResolveVersion :: V2 {
617- let source = node. source_id ( ) ;
618- if let Some ( GitReference :: DefaultBranch ) = source. git_reference ( ) {
619- let new_source =
620- SourceId :: for_git ( source. url ( ) , GitReference :: Branch ( "master" . to_string ( ) ) )
621- . unwrap ( )
622- . with_precise ( source. precise ( ) . map ( |s| s. to_string ( ) ) ) ;
623-
624- let node = node. with_source_id ( new_source) ;
625- registry. register_lock ( node, deps. clone ( ) ) ;
626- }
627- }
628-
602+ . collect ( ) ;
629603 registry. register_lock ( node, deps) ;
630604 }
631605
0 commit comments