Preserve indexed executable modes in WASI git
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user