File tree Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Original file line number Diff line number Diff line change @@ -626,8 +626,11 @@ fn list_files_gix(
626626 . filter ( |res| {
627627 // Don't include Cargo.lock if it is untracked. Packaging will
628628 // generate a new one as needed.
629+ // Also don't include untrackable directory entries, like FIFOs.
629630 res. as_ref ( ) . map_or ( true , |item| {
630- !( item. entry . status == Status :: Untracked && item. entry . rela_path == "Cargo.lock" )
631+ item. entry . disk_kind != Some ( gix:: dir:: entry:: Kind :: Untrackable )
632+ && !( item. entry . status == Status :: Untracked
633+ && item. entry . rela_path == "Cargo.lock" )
631634 } )
632635 } )
633636 . map ( |res| res. map ( |item| ( item. entry . rela_path , item. entry . disk_kind ) ) )
@@ -751,7 +754,8 @@ fn list_files_walk(
751754 for entry in walkdir {
752755 match entry {
753756 Ok ( entry) => {
754- if !entry. file_type ( ) . is_dir ( ) {
757+ let file_type = entry. file_type ( ) ;
758+ if file_type. is_file ( ) || file_type. is_symlink ( ) {
755759 ret. push ( entry. into_path ( ) ) ;
756760 }
757761 }
Original file line number Diff line number Diff line change @@ -4221,3 +4221,34 @@ src/lib.rs
42214221"# ] ] )
42224222 . run ( ) ;
42234223}
4224+
4225+ #[ cargo_test]
4226+ #[ cfg( unix) ]
4227+ fn simple_with_fifo ( ) {
4228+ let git_project = git:: new ( "foo" , |project| {
4229+ project
4230+ . file (
4231+ "Cargo.toml" ,
4232+ r#"
4233+ [package]
4234+ name = "foo"
4235+ version = "0.1.0"
4236+ edition = "2015"
4237+ "# ,
4238+ )
4239+ . file ( "src/main.rs" , "fn main() {}" )
4240+ } ) ;
4241+
4242+ std:: process:: Command :: new ( "mkfifo" )
4243+ . current_dir ( git_project. root ( ) )
4244+ . arg ( git_project. root ( ) . join ( "blocks-when-read" ) )
4245+ . status ( )
4246+ . expect ( "a FIFO can be created" ) ;
4247+
4248+ // Avoid actual blocking even in case of failure, assuming that what it lists here
4249+ // would also be read eventually.
4250+ git_project
4251+ . cargo ( "package -l" )
4252+ . with_stdout_does_not_contain ( "blocks-when-read" )
4253+ . run ( ) ;
4254+ }
Original file line number Diff line number Diff line change @@ -6873,3 +6873,32 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
68736873"# ] ] )
68746874 . run ( ) ;
68756875}
6876+
6877+ #[ cargo_test]
6878+ #[ cfg( unix) ]
6879+ fn simple_with_fifo ( ) {
6880+ let p = project ( )
6881+ . file (
6882+ "Cargo.toml" ,
6883+ r#"
6884+ [package]
6885+ name = "foo"
6886+ version = "0.1.0"
6887+ edition = "2015"
6888+ "# ,
6889+ )
6890+ . file ( "src/main.rs" , "fn main() {}" )
6891+ . build ( ) ;
6892+
6893+ std:: process:: Command :: new ( "mkfifo" )
6894+ . current_dir ( p. root ( ) )
6895+ . arg ( p. root ( ) . join ( "blocks-when-read" ) )
6896+ . status ( )
6897+ . expect ( "a FIFO can be created" ) ;
6898+
6899+ // Avoid actual blocking even in case of failure, assuming that what it lists here
6900+ // would also be read eventually.
6901+ p. cargo ( "package -l" )
6902+ . with_stdout_does_not_contain ( "blocks-when-read" )
6903+ . run ( ) ;
6904+ }
You can’t perform that action at this time.
0 commit comments