fix executable-bit handling during checkout#2730
Merged
Merged
Conversation
--- 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]>
Sebastian Thiel (Byron)
force-pushed
the
delayed-filters-exec-bit
branch
from
July 21, 2026 14:41
7cc9700 to
c6b803b
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
July 21, 2026 14:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
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
Fixes #1783
Fixes #1784
Git baseline
Git creates regular checkout files according to the cache-entry mode in
entry.c. Its delayed checkout path retriescheckout_entry()with that cache entry, andgit checkout --forcedoes not retain obsolete executable permissions.Tests
cargo test -p gix-worktree-state --all-featurescargo clippy -p gix-worktree-state --all-targets --all-features -- -D warningscargo fmt --all -- --check