File tree 3 files changed +79
-2
lines changed 3 files changed +79
-2
lines changed Original file line number Diff line number Diff line change @@ -626,8 +626,11 @@ fn list_files_gix(
626
626
. filter ( |res| {
627
627
// Don't include Cargo.lock if it is untracked. Packaging will
628
628
// generate a new one as needed.
629
+ // Also don't include untrackable directory entries, like FIFOs.
629
630
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" )
631
634
} )
632
635
} )
633
636
. map ( |res| res. map ( |item| ( item. entry . rela_path , item. entry . disk_kind ) ) )
@@ -751,7 +754,8 @@ fn list_files_walk(
751
754
for entry in walkdir {
752
755
match entry {
753
756
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 ( ) {
755
759
ret. push ( entry. into_path ( ) ) ;
756
760
}
757
761
}
Original file line number Diff line number Diff line change @@ -4221,3 +4221,41 @@ src/lib.rs
4221
4221
"# ] ] )
4222
4222
. run ( ) ;
4223
4223
}
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_data ( str![ [ r#"
4253
+ .cargo_vcs_info.json
4254
+ Cargo.lock
4255
+ Cargo.toml
4256
+ Cargo.toml.orig
4257
+ src/main.rs
4258
+
4259
+ "# ] ] )
4260
+ . run ( ) ;
4261
+ }
Original file line number Diff line number Diff line change @@ -6873,3 +6873,38 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
6873
6873
"# ] ] )
6874
6874
. run ( ) ;
6875
6875
}
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_data ( str![ [ r#"
6903
+ Cargo.lock
6904
+ Cargo.toml
6905
+ Cargo.toml.orig
6906
+ src/main.rs
6907
+
6908
+ "# ] ] )
6909
+ . run ( ) ;
6910
+ }
You can’t perform that action at this time.
0 commit comments