1
- use crate :: status :: fixture_path;
1
+ use crate :: fixture_path;
2
2
use bstr:: ByteSlice ;
3
3
use gix_diff:: blob:: pipeline:: WorktreeRoots ;
4
4
use gix_diff:: rewrites:: CopySource ;
@@ -83,6 +83,7 @@ fn changed_and_untracked_and_renamed() {
83
83
track_empty : true ,
84
84
} ;
85
85
let out = fixture_filtered_detailed (
86
+ "status_many.sh" ,
86
87
"changed-and-untracked-and-renamed" ,
87
88
& [ ] ,
88
89
& expectations_with_dirwalk,
@@ -100,9 +101,38 @@ fn changed_and_untracked_and_renamed() {
100
101
) ;
101
102
}
102
103
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
+ }
103
132
#[ test]
104
133
fn changed_and_untracked ( ) {
105
134
let out = fixture_filtered_detailed (
135
+ "status_many.sh" ,
106
136
"changed-and-untracked" ,
107
137
& [ ] ,
108
138
& [ Expectation :: Modification {
@@ -144,6 +174,7 @@ fn changed_and_untracked() {
144
174
} ,
145
175
] ;
146
176
let out = fixture_filtered_detailed (
177
+ "status_many.sh" ,
147
178
"changed-and-untracked" ,
148
179
& [ ] ,
149
180
& expectations_with_dirwalk,
@@ -163,6 +194,7 @@ fn changed_and_untracked() {
163
194
assert_eq ! ( out. rewrites, None , "rewrites are still not configured" ) ;
164
195
165
196
let out = fixture_filtered_detailed (
197
+ "status_many.sh" ,
166
198
"changed-and-untracked" ,
167
199
& [ ] ,
168
200
& expectations_with_dirwalk,
@@ -179,6 +211,7 @@ fn changed_and_untracked() {
179
211
}
180
212
181
213
fn fixture_filtered_detailed (
214
+ script : & str ,
182
215
subdir : & str ,
183
216
pathspecs : & [ & str ] ,
184
217
expected : & [ Expectation < ' _ > ] ,
@@ -193,11 +226,11 @@ fn fixture_filtered_detailed(
193
226
out
194
227
}
195
228
196
- let worktree = fixture_path ( "status_many.sh" ) . join ( subdir) ;
229
+ let worktree = fixture_path ( script ) . join ( subdir) ;
197
230
let git_dir = worktree. join ( ".git" ) ;
198
231
let index = gix_index:: File :: at ( git_dir. join ( "index" ) , gix_hash:: Kind :: Sha1 , false , Default :: default ( ) ) . unwrap ( ) ;
199
232
let search = gix_pathspec:: Search :: from_specs (
200
- crate :: status :: index_as_worktree:: to_pathspecs ( pathspecs) ,
233
+ crate :: index_as_worktree:: to_pathspecs ( pathspecs) ,
201
234
None ,
202
235
std:: path:: Path :: new ( "" ) ,
203
236
)
@@ -247,7 +280,7 @@ fn fixture_filtered_detailed(
247
280
object_hash : gix_hash:: Kind :: Sha1 ,
248
281
tracked_file_modifications : gix_status:: index_as_worktree:: Options {
249
282
fs : capabilities,
250
- stat : crate :: status :: index_as_worktree:: TEST_OPTIONS ,
283
+ stat : crate :: index_as_worktree:: TEST_OPTIONS ,
251
284
..Default :: default ( )
252
285
} ,
253
286
dirwalk,
@@ -262,7 +295,7 @@ fn fixture_filtered_detailed(
262
295
& worktree,
263
296
& mut recorder,
264
297
FastEq ,
265
- crate :: status :: index_as_worktree:: SubmoduleStatusMock { dirty : false } ,
298
+ crate :: index_as_worktree:: SubmoduleStatusMock { dirty : false } ,
266
299
objects,
267
300
& mut gix_features:: progress:: Discard ,
268
301
context,
0 commit comments