diff --git a/gix-status/tests/fixtures/generated-archives/status_many.tar b/gix-status/tests/fixtures/generated-archives/status_many.tar index 8e656859d8e..3798ad8560d 100644 Binary files a/gix-status/tests/fixtures/generated-archives/status_many.tar and b/gix-status/tests/fixtures/generated-archives/status_many.tar differ diff --git a/gix-status/tests/fixtures/status_many.sh b/gix-status/tests/fixtures/status_many.sh index 9a11f3f4f8d..563a075ba6e 100755 --- a/gix-status/tests/fixtures/status_many.sh +++ b/gix-status/tests/fixtures/status_many.sh @@ -39,3 +39,10 @@ cp -R changed-and-untracked changed-and-untracked-and-renamed echo change >> content-with-rewrite ) + +cp -R changed-and-untracked replace-dir-with-file +(cd replace-dir-with-file + rm untracked + rm -Rf dir/ + touch dir +) diff --git a/gix-status/tests/status/index_as_worktree.rs b/gix-status/tests/status/index_as_worktree.rs index 27a3a272c0b..fe686212b97 100644 --- a/gix-status/tests/status/index_as_worktree.rs +++ b/gix-status/tests/status/index_as_worktree.rs @@ -243,6 +243,27 @@ fn removed() { ); } +#[test] +fn replace_dir_with_file() { + let out = fixture_filtered_detailed( + "status_many", + "replace-dir-with-file", + &[], + &[(BStr::new(b"dir/content"), 0, status_removed())], + |_| {}, + false, + ); + assert_eq!( + out, + Outcome { + entries_to_process: 4, + entries_processed: 4, + symlink_metadata_calls: 4, + ..Default::default() + } + ); +} + #[test] fn subomdule_nochange() { assert_eq!(