@@ -598,56 +598,62 @@ mod scanner {
598
598
& [
599
599
// This file should always be picked up
600
600
( "home/project/apps/web/index.html" , "content-['index.html']" ) ,
601
-
602
601
// Set up various ignore rules
603
602
( "home/.gitignore" , "ignore-home.html" ) ,
604
603
( "home/project/.gitignore" , "ignore-project.html" ) ,
605
604
( "home/project/apps/.gitignore" , "ignore-apps.html" ) ,
606
605
( "home/project/apps/web/.gitignore" , "ignore-web.html" ) ,
607
-
608
606
// Some of these should be ignored depending on which dir is the repo root
609
- ( "home/project/apps/web/ignore-home.html" , "content-['ignore-home.html']" ) ,
610
- ( "home/project/apps/web/ignore-project.html" , "content-['ignore-project.html']" ) ,
611
- ( "home/project/apps/web/ignore-apps.html" , "content-['ignore-apps.html']" ) ,
612
- ( "home/project/apps/web/ignore-web.html" , "content-['ignore-web.html']" ) ,
607
+ (
608
+ "home/project/apps/web/ignore-home.html" ,
609
+ "content-['ignore-home.html']" ,
610
+ ) ,
611
+ (
612
+ "home/project/apps/web/ignore-project.html" ,
613
+ "content-['ignore-project.html']" ,
614
+ ) ,
615
+ (
616
+ "home/project/apps/web/ignore-apps.html" ,
617
+ "content-['ignore-apps.html']" ,
618
+ ) ,
619
+ (
620
+ "home/project/apps/web/ignore-web.html" ,
621
+ "content-['ignore-web.html']" ,
622
+ ) ,
613
623
] ,
614
624
) ;
615
625
616
-
617
- let sources = vec ! [
618
- GlobEntry {
619
- base : dir . join ( "home/project/apps/web" ) . to_string_lossy( ) . to_string ( ) ,
620
- pattern : "**/*" . to_owned ( ) ,
621
- } ,
622
- ] ;
626
+ let sources = vec ! [ GlobEntry {
627
+ base : dir
628
+ . join ( "home/project/apps/web" )
629
+ . to_string_lossy( )
630
+ . to_string ( ) ,
631
+ pattern : "**/*" . to_owned ( ) ,
632
+ } ] ;
623
633
624
634
let candidates = Scanner :: new ( Some ( sources. clone ( ) ) ) . scan ( ) ;
625
635
626
636
// All ignore files are applied because there's no git repo
627
- assert_eq ! (
628
- candidates,
629
- vec![
630
- "content-['index.html']" . to_owned( ) ,
631
- ]
632
- ) ;
637
+ assert_eq ! ( candidates, vec![ "content-['index.html']" . to_owned( ) , ] ) ;
633
638
634
639
// Initialize `home` as a git repository and scan again
635
640
// The results should be the same as before
636
- _ = Command :: new ( "git" ) . arg ( "init" ) . current_dir ( dir. join ( "home" ) ) . output ( ) ;
641
+ _ = Command :: new ( "git" )
642
+ . arg ( "init" )
643
+ . current_dir ( dir. join ( "home" ) )
644
+ . output ( ) ;
637
645
let candidates = Scanner :: new ( Some ( sources. clone ( ) ) ) . scan ( ) ;
638
646
639
- assert_eq ! (
640
- candidates,
641
- vec![
642
- "content-['index.html']" . to_owned( ) ,
643
- ]
644
- ) ;
647
+ assert_eq ! ( candidates, vec![ "content-['index.html']" . to_owned( ) , ] ) ;
645
648
646
649
// Drop the .git folder
647
650
fs:: remove_dir_all ( dir. join ( "home/.git" ) ) . unwrap ( ) ;
648
651
649
652
// Initialize `home/project` as a git repository and scan again
650
- _ = Command :: new ( "git" ) . arg ( "init" ) . current_dir ( dir. join ( "home/project" ) ) . output ( ) ;
653
+ _ = Command :: new ( "git" )
654
+ . arg ( "init" )
655
+ . current_dir ( dir. join ( "home/project" ) )
656
+ . output ( ) ;
651
657
let candidates = Scanner :: new ( Some ( sources. clone ( ) ) ) . scan ( ) ;
652
658
653
659
assert_eq ! (
@@ -662,7 +668,10 @@ mod scanner {
662
668
fs:: remove_dir_all ( dir. join ( "home/project/.git" ) ) . unwrap ( ) ;
663
669
664
670
// Initialize `home/project/apps` as a git repository and scan again
665
- _ = Command :: new ( "git" ) . arg ( "init" ) . current_dir ( dir. join ( "home/project/apps" ) ) . output ( ) ;
671
+ _ = Command :: new ( "git" )
672
+ . arg ( "init" )
673
+ . current_dir ( dir. join ( "home/project/apps" ) )
674
+ . output ( ) ;
666
675
let candidates = Scanner :: new ( Some ( sources. clone ( ) ) ) . scan ( ) ;
667
676
668
677
assert_eq ! (
@@ -678,7 +687,10 @@ mod scanner {
678
687
fs:: remove_dir_all ( dir. join ( "home/project/apps/.git" ) ) . unwrap ( ) ;
679
688
680
689
// Initialize `home/project/apps` as a git repository and scan again
681
- _ = Command :: new ( "git" ) . arg ( "init" ) . current_dir ( dir. join ( "home/project/apps/web" ) ) . output ( ) ;
690
+ _ = Command :: new ( "git" )
691
+ . arg ( "init" )
692
+ . current_dir ( dir. join ( "home/project/apps/web" ) )
693
+ . output ( ) ;
682
694
let candidates = Scanner :: new ( Some ( sources. clone ( ) ) ) . scan ( ) ;
683
695
684
696
assert_eq ! (
0 commit comments