Skip to content

Commit 77412ba

Browse files
committed
reproduce 'status' issue
Replacing a directory with non-directory seems to be the issue.
1 parent ad6b9b6 commit 77412ba

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Binary file not shown.

gix-status/tests/fixtures/status_many.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ cp -R changed-and-untracked changed-and-untracked-and-renamed
3939
echo change >> content-with-rewrite
4040

4141
)
42+
43+
cp -R changed-and-untracked replace-dir-with-file
44+
(cd replace-dir-with-file
45+
rm untracked
46+
rm -Rf dir/
47+
touch dir
48+
)

gix-status/tests/status/index_as_worktree.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,27 @@ fn removed() {
243243
);
244244
}
245245

246+
#[test]
247+
fn replace_dir_with_file() {
248+
let out = fixture_filtered_detailed(
249+
"status_many",
250+
"replace-dir-with-file",
251+
&[],
252+
&[(BStr::new(b"dir/content"), 0, status_removed())],
253+
|_| {},
254+
false,
255+
);
256+
assert_eq!(
257+
out,
258+
Outcome {
259+
entries_to_process: 4,
260+
entries_processed: 4,
261+
symlink_metadata_calls: 4,
262+
..Default::default()
263+
}
264+
);
265+
}
266+
246267
#[test]
247268
fn subomdule_nochange() {
248269
assert_eq!(

0 commit comments

Comments
 (0)