@@ -15,12 +15,10 @@ use crate::core::registry::PackageRegistry;
15
15
use crate :: core:: resolver:: features:: {
16
16
FeatureOpts , FeatureResolver , ForceAllTargets , ResolvedFeatures ,
17
17
} ;
18
- use crate :: core:: resolver:: { self , HasDevUnits , Resolve , ResolveOpts , ResolveVersion } ;
18
+ use crate :: core:: resolver:: { self , HasDevUnits , Resolve , ResolveOpts } ;
19
19
use crate :: core:: summary:: Summary ;
20
20
use 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 } ;
24
22
use crate :: ops;
25
23
use crate :: sources:: PathSource ;
26
24
use crate :: util:: errors:: { CargoResult , CargoResultExt } ;
@@ -601,31 +599,7 @@ fn register_previous_locks(
601
599
. deps_not_replaced ( node)
602
600
. map ( |p| p. 0 )
603
601
. 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 ( ) ;
629
603
registry. register_lock ( node, deps) ;
630
604
}
631
605
0 commit comments