Skip to content

Commit

Permalink
reproduce 'status' issue
Browse files Browse the repository at this point in the history
Replacing a directory with non-directory seems to be the issue.
  • Loading branch information
Byron committed Dec 22, 2024
1 parent ad6b9b6 commit 77412ba
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Binary file modified gix-status/tests/fixtures/generated-archives/status_many.tar
Binary file not shown.
7 changes: 7 additions & 0 deletions gix-status/tests/fixtures/status_many.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
21 changes: 21 additions & 0 deletions gix-status/tests/status/index_as_worktree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 77412ba

Please sign in to comment.