File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -1568,6 +1568,67 @@ path = [..]
1568
1568
) ;
1569
1569
}
1570
1570
1571
+ #[ cargo_test]
1572
+ fn git_update_rev ( ) {
1573
+ let ( git_project, git_repo) = git:: new_repo ( "git" , |p| {
1574
+ p. file ( "Cargo.toml" , & basic_manifest ( "a" , "0.1.0" ) )
1575
+ . file ( "src/lib.rs" , "" )
1576
+ } ) ;
1577
+ let url = git_project. url ( ) ;
1578
+ let ref_1 = "initial" ;
1579
+ let ref_2 = "update" ;
1580
+
1581
+ git:: tag ( & git_repo, ref_1) ;
1582
+
1583
+ git_project. change_file ( "src/lib.rs" , "pub fn f() {}" ) ;
1584
+ git:: add ( & git_repo) ;
1585
+ git:: commit ( & git_repo) ;
1586
+ git:: tag ( & git_repo, ref_2) ;
1587
+
1588
+ let p = project ( )
1589
+ . file (
1590
+ "Cargo.toml" ,
1591
+ & format ! (
1592
+ r#"
1593
+ [package]
1594
+ name = "foo"
1595
+ version = "0.1.0"
1596
+
1597
+ [dependencies]
1598
+ a = {{ git = '{url}', rev = '{ref_1}' }}
1599
+ "#
1600
+ ) ,
1601
+ )
1602
+ . file ( "src/lib.rs" , "" )
1603
+ . build ( ) ;
1604
+
1605
+ p. cargo ( "vendor --respect-source-config --versioned-dirs" )
1606
+ . run ( ) ;
1607
+
1608
+ let lib = p. read_file ( "vendor/a-0.1.0/src/lib.rs" ) ;
1609
+ assert_e2e ( ) . eq ( lib, "" ) ;
1610
+
1611
+ p. change_file (
1612
+ "Cargo.toml" ,
1613
+ & format ! (
1614
+ r#"
1615
+ [package]
1616
+ name = "foo"
1617
+ version = "0.1.0"
1618
+
1619
+ [dependencies]
1620
+ a = {{ git = '{url}', rev = '{ref_2}' }}
1621
+ "#
1622
+ ) ,
1623
+ ) ;
1624
+
1625
+ p. cargo ( "vendor --respect-source-config --versioned-dirs" )
1626
+ . run ( ) ;
1627
+
1628
+ let lib = p. read_file ( "vendor/a-0.1.0/src/lib.rs" ) ;
1629
+ assert_e2e ( ) . eq ( lib, "" ) ;
1630
+ }
1631
+
1571
1632
#[ cargo_test]
1572
1633
fn depend_on_vendor_dir_not_deleted ( ) {
1573
1634
let p = project ( )
You can’t perform that action at this time.
0 commit comments