From fc2021fbfc1051b666ea9a2add6225dd9843e772 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 16 Jan 2025 12:31:40 +0100 Subject: [PATCH] Assure that the recently added `worktree_mode` actually represents it. --- gix-index/src/entry/mode.rs | 2 ++ gix-status/tests/status/index_as_worktree.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gix-index/src/entry/mode.rs b/gix-index/src/entry/mode.rs index 6221287824f..63e08decd92 100644 --- a/gix-index/src/entry/mode.rs +++ b/gix-index/src/entry/mode.rs @@ -60,6 +60,8 @@ impl Mode { Mode::COMMIT } else if executable_bit && stat.is_executable() { Mode::FILE_EXECUTABLE + } else if has_symlinks && stat.is_symlink() { + Mode::SYMLINK } else { Mode::FILE }; diff --git a/gix-status/tests/status/index_as_worktree.rs b/gix-status/tests/status/index_as_worktree.rs index ff5e7ee5668..4537fc3c7ae 100644 --- a/gix-status/tests/status/index_as_worktree.rs +++ b/gix-status/tests/status/index_as_worktree.rs @@ -620,7 +620,7 @@ fn refresh() { BStr::new(b"empty"), 3, Change::Type { - worktree_mode: entry::Mode::FILE + worktree_mode: entry::Mode::SYMLINK } .into() ), @@ -651,7 +651,7 @@ fn refresh() { BStr::new("empty"), 3, Change::Type { - worktree_mode: entry::Mode::FILE + worktree_mode: entry::Mode::SYMLINK } .into() ), @@ -707,7 +707,7 @@ fn modified() { BStr::new(b"empty"), 3, Change::Type { - worktree_mode: entry::Mode::FILE, + worktree_mode: entry::Mode::SYMLINK, } .into(), ), @@ -738,7 +738,7 @@ fn modified() { BStr::new("empty"), 3, Change::Type { - worktree_mode: entry::Mode::FILE, + worktree_mode: entry::Mode::SYMLINK, } .into(), ),