Preserve indexed executable modes in WASI git

This commit is contained in:
2026-11-06 20:04:06 +00:00
parent 3e33a85a6c
commit cd324678fe
3 changed files with 37 additions and 3 deletions
+17 -1
View File
@@ -238,6 +238,22 @@ pub fn status(repo: &gix::Repository) -> Result<Status> {
.map_err(|e| error("status", e))?;
for item in iter {
let item = item.map_err(|e| error("status", e))?;
#[cfg(target_os = "wasi")]
if matches!(
&item,
Item::Modification {
status: gix::status::plumbing::index_as_worktree::EntryStatus::Change(
gix::status::plumbing::index_as_worktree::Change::Modification {
executable_bit_changed: true,
content_change: None,
..
}
),
..
}
) {
continue;
}
let path = item.rela_path().to_str_lossy().into_owned();
let Some(summary) = item.summary() else {
continue;
@@ -332,7 +348,7 @@ fn worktree_file(
} else {
entry.mode
};
#[cfg(unix)]
#[cfg(all(unix, not(target_os = "wasi")))]
let mode = if mode != 0o120000 && caps.executable_bit {
use std::os::unix::fs::PermissionsExt;
if meta.permissions().mode() & 0o111 != 0 {