1- use crate :: status :: fixture_path;
1+ use crate :: fixture_path;
22use bstr:: ByteSlice ;
33use gix_diff:: blob:: pipeline:: WorktreeRoots ;
44use gix_diff:: rewrites:: CopySource ;
@@ -83,6 +83,7 @@ fn changed_and_untracked_and_renamed() {
8383 track_empty : true ,
8484 } ;
8585 let out = fixture_filtered_detailed (
86+ "status_many.sh" ,
8687 "changed-and-untracked-and-renamed" ,
8788 & [ ] ,
8889 & expectations_with_dirwalk,
@@ -100,9 +101,38 @@ fn changed_and_untracked_and_renamed() {
100101 ) ;
101102}
102103
104+ #[ test]
105+ #[ cfg( unix) ]
106+ fn nonfile_untracked_are_not_visible ( ) {
107+ fixture_filtered_detailed (
108+ "status_nonfile.sh" ,
109+ "untracked" ,
110+ & [ ] ,
111+ & [ ] ,
112+ None ,
113+ Some ( Default :: default ( ) ) ,
114+ ) ;
115+ }
116+
117+ #[ test]
118+ #[ cfg( unix) ]
119+ fn tracked_changed_to_non_file ( ) {
120+ fixture_filtered_detailed (
121+ "status_nonfile.sh" ,
122+ "tracked-swapped" ,
123+ & [ ] ,
124+ & [ Expectation :: Modification {
125+ rela_path : "file" ,
126+ status : Change :: Type . into ( ) ,
127+ } ] ,
128+ None ,
129+ Some ( Default :: default ( ) ) ,
130+ ) ;
131+ }
103132#[ test]
104133fn changed_and_untracked ( ) {
105134 let out = fixture_filtered_detailed (
135+ "status_many.sh" ,
106136 "changed-and-untracked" ,
107137 & [ ] ,
108138 & [ Expectation :: Modification {
@@ -144,6 +174,7 @@ fn changed_and_untracked() {
144174 } ,
145175 ] ;
146176 let out = fixture_filtered_detailed (
177+ "status_many.sh" ,
147178 "changed-and-untracked" ,
148179 & [ ] ,
149180 & expectations_with_dirwalk,
@@ -163,6 +194,7 @@ fn changed_and_untracked() {
163194 assert_eq ! ( out. rewrites, None , "rewrites are still not configured" ) ;
164195
165196 let out = fixture_filtered_detailed (
197+ "status_many.sh" ,
166198 "changed-and-untracked" ,
167199 & [ ] ,
168200 & expectations_with_dirwalk,
@@ -179,6 +211,7 @@ fn changed_and_untracked() {
179211}
180212
181213fn fixture_filtered_detailed (
214+ script : & str ,
182215 subdir : & str ,
183216 pathspecs : & [ & str ] ,
184217 expected : & [ Expectation < ' _ > ] ,
@@ -193,11 +226,11 @@ fn fixture_filtered_detailed(
193226 out
194227 }
195228
196- let worktree = fixture_path ( "status_many.sh" ) . join ( subdir) ;
229+ let worktree = fixture_path ( script ) . join ( subdir) ;
197230 let git_dir = worktree. join ( ".git" ) ;
198231 let index = gix_index:: File :: at ( git_dir. join ( "index" ) , gix_hash:: Kind :: Sha1 , false , Default :: default ( ) ) . unwrap ( ) ;
199232 let search = gix_pathspec:: Search :: from_specs (
200- crate :: status :: index_as_worktree:: to_pathspecs ( pathspecs) ,
233+ crate :: index_as_worktree:: to_pathspecs ( pathspecs) ,
201234 None ,
202235 std:: path:: Path :: new ( "" ) ,
203236 )
@@ -247,7 +280,7 @@ fn fixture_filtered_detailed(
247280 object_hash : gix_hash:: Kind :: Sha1 ,
248281 tracked_file_modifications : gix_status:: index_as_worktree:: Options {
249282 fs : capabilities,
250- stat : crate :: status :: index_as_worktree:: TEST_OPTIONS ,
283+ stat : crate :: index_as_worktree:: TEST_OPTIONS ,
251284 ..Default :: default ( )
252285 } ,
253286 dirwalk,
@@ -262,7 +295,7 @@ fn fixture_filtered_detailed(
262295 & worktree,
263296 & mut recorder,
264297 FastEq ,
265- crate :: status :: index_as_worktree:: SubmoduleStatusMock { dirty : false } ,
298+ crate :: index_as_worktree:: SubmoduleStatusMock { dirty : false } ,
266299 objects,
267300 & mut gix_features:: progress:: Discard ,
268301 context,
0 commit comments