@@ -639,7 +639,7 @@ mod tests {
639
639
640
640
#[ test]
641
641
fn test_root_relative_paths ( ) -> Result < ( ) , Error > {
642
- let ( tmp_dir , repo_root) = tmp_dir ( ) ;
642
+ let ( _ , repo_root) = tmp_dir ( ) ;
643
643
setup_repository ( & repo_root) ;
644
644
645
645
// Create a package with some files
@@ -656,57 +656,58 @@ mod tests {
656
656
657
657
commit_all ( & repo_root) ;
658
658
659
- let git = Git :: new ( & repo_root) ?;
659
+ let scm = SCM :: new ( & repo_root) ;
660
+
660
661
let pkg_path = AnchoredSystemPath :: new ( "my-pkg" ) ?;
661
662
662
663
// Test with $TURBO_ROOT$ and root-relative path
663
- let hashes = git . get_package_file_hashes (
664
+ let hashes = scm . get_package_file_hashes (
664
665
& repo_root,
665
666
pkg_path,
666
667
& [ "$TURBO_ROOT$" , "root-file.txt" ] ,
667
- false ,
668
+ None ,
668
669
) ?;
669
670
670
671
assert ! (
671
- hashes. contains_key( "root-file.txt" ) ,
672
+ hashes. contains_key( & RelativeUnixPathBuf :: new ( "root-file.txt" ) . unwrap ( ) ) ,
672
673
"Should include root file"
673
674
) ;
674
675
assert ! (
675
- !hashes. contains_key( "my-pkg/pkg-file.txt" ) ,
676
+ !hashes. contains_key( & RelativeUnixPathBuf :: new ( "my-pkg/pkg-file.txt" ) . unwrap ( ) ) ,
676
677
"Should not include package file"
677
678
) ;
678
679
679
680
// Test with $TURBO_ROOT$ and package-relative path
680
- let hashes = git . get_package_file_hashes (
681
+ let hashes = scm . get_package_file_hashes (
681
682
& repo_root,
682
683
pkg_path,
683
684
& [ "$TURBO_ROOT$" , "pkg-file.txt" ] ,
684
- false ,
685
+ None ,
685
686
) ?;
686
687
687
688
assert ! (
688
- hashes. contains_key( "my-pkg/pkg-file.txt" ) ,
689
+ hashes. contains_key( & RelativeUnixPathBuf :: new ( "my-pkg/pkg-file.txt" ) . unwrap ( ) ) ,
689
690
"Should include package file"
690
691
) ;
691
692
assert ! (
692
- !hashes. contains_key( "root-file.txt" ) ,
693
+ !hashes. contains_key( & RelativeUnixPathBuf :: new ( "root-file.txt" ) . unwrap ( ) ) ,
693
694
"Should not include root file"
694
695
) ;
695
696
696
697
// Test with $TURBO_ROOT$ and both root and package paths
697
- let hashes = git . get_package_file_hashes (
698
+ let hashes = scm . get_package_file_hashes (
698
699
& repo_root,
699
700
pkg_path,
700
701
& [ "$TURBO_ROOT$" , "root-file.txt" , "pkg-file.txt" ] ,
701
- false ,
702
+ None ,
702
703
) ?;
703
704
704
705
assert ! (
705
- hashes. contains_key( "root-file.txt" ) ,
706
+ hashes. contains_key( & RelativeUnixPathBuf :: new ( "root-file.txt" ) . unwrap ( ) ) ,
706
707
"Should include root file"
707
708
) ;
708
709
assert ! (
709
- hashes. contains_key( "my-pkg/pkg-file.txt" ) ,
710
+ hashes. contains_key( & RelativeUnixPathBuf :: new ( "my-pkg/pkg-file.txt" ) . unwrap ( ) ) ,
710
711
"Should include package file"
711
712
) ;
712
713
0 commit comments