Skip to content

Test overwrite_existing apparent symlink dereferencing #2008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ jobs:
- macos-latest
- ubuntu-latest
- ubuntu-24.04-arm
fail-fast: false

runs-on: ${{ matrix.os }}

Expand Down
34 changes: 34 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gix-worktree-state/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ symlink = "0.1.0"
once_cell = "1.21.3"

walkdir = "2.3.2"
test-case = "3.3.1"
5 changes: 3 additions & 2 deletions gix-worktree-state/tests/state/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use gix_object::{bstr::ByteSlice, Data};
use gix_testtools::tempfile::TempDir;
use gix_worktree_state::checkout::Collision;
use once_cell::sync::Lazy;
use test_case::test_matrix;

use crate::fixture_path;

Expand Down Expand Up @@ -103,8 +104,8 @@ fn accidental_writes_through_symlinks_are_prevented_if_overwriting_is_forbidden(
}
}

#[test]
fn writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed() {
#[test_matrix(0..=999)]
fn writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed(_i: i32) {
let mut opts = opts_from_probe();
// with overwrite mode
opts.overwrite_existing = true;
Expand Down
Loading