Skip to content

fix executable-bit handling during checkout#2730

Merged
Sebastian Thiel (Byron) merged 2 commits into
mainfrom
delayed-filters-exec-bit
Jul 21, 2026
Merged

fix executable-bit handling during checkout#2730
Sebastian Thiel (Byron) merged 2 commits into
mainfrom
delayed-filters-exec-bit

Conversation

@Byron

@Byron Sebastian Thiel (Byron) commented Jul 20, 2026

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

Everything below this line was generated by Codex GPT-5.

Created by Codex on behalf of Byron. Byron will review before this is ready to merge.

Summary

  • remove obsolete executable bits when nonexclusive checkout reuses a tracked non-executable file
  • preserve executable-bit handling when a process filter delays checkout output
  • keep mode changes tied to the open file descriptor and cover delayed +x and -x paths

Fixes #1783
Fixes #1784

Git baseline

Git creates regular checkout files according to the cache-entry mode in entry.c. Its delayed checkout path retries checkout_entry() with that cache entry, and git checkout --force does not retain obsolete executable permissions.

Tests

  • cargo test -p gix-worktree-state --all-features
  • cargo clippy -p gix-worktree-state --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

Sebastian Thiel (Byron) and others added 2 commits July 21, 2026 16:38
--- agent

Nonexclusive checkout reused regular files and only represented a pending
executable-mode update as a boolean for adding +x. A tracked non-executable
file therefore retained executable bits from the existing worktree file.

Add a regression that inverts the modes of existing executable and
non-executable files for both overwrite_existing settings. Replace the
one-way boolean with an internal set/remove/unchanged action, and adjust
mode bits when needed through the already-open file descriptor before
recording stat data
Special bits are cleared whenever executable bits are adjusted.

Git baseline: entry.c creates checkout files using the cache-entry mode, and
git checkout --force does not retain obsolete executable permissions.

Co-authored-by: GPT 5.6 <[email protected]>
--- agent

Delayed process-filter results recorded a false needs-executable-bit value
and later passed it as the filesystem capability. Exclusive checkout therefore
created filtered executable files without +x, while nonexclusive checkout
also skipped removing obsolete +x from filtered non-executable files.

Carry the actual filesystem executable-bit capability through delayed
processing and let the normal open/finalize path derive the required mode
action from the index entry. Extend the delayed-filter fixture and cover both
exclusive +x application and nonexclusive +x removal.

Git baseline: entry.c creates delayed checkout output using the cache entry
mode when finish_delayed_checkout() retries checkout_entry().

Co-authored-by: GPT 5.6 <[email protected]>
@Byron
Sebastian Thiel (Byron) marked this pull request as ready for review July 21, 2026 14:41
@Byron
Sebastian Thiel (Byron) merged commit b4f7d9f into main Jul 21, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nonexclusive checkout never removes executable permissions Delayed process filters suppress +x in gix clone

1 participant