Commit 0becc91
committed
change: Set +x via open file descriptor, not path
When executable permissions were set on a file being checked out,
and when it was done after the file was already created, this was
done on its path, using `chmod` (via a higher level abstraction).
But we have an open `File` object for it already, at that point.
This uses `fchmod` on the existing open file descriptor (obtained
from the `File` object), instead of `chmod` on the path.
(Since #1764, the file mode has also been read first, to figure out
what new mode to set it to for +x. That uses `lstat` (via a higher
level abstraction). The change here is therefore really only half
of what should be done. To complete it, and also to avoid new
problems due to a new inconsistency, that should be done with
`fstat` on the file descriptor instead of `lstat` on the path. That
will be done in a directly fortcoming commit -- after portability
issues in the type of the `st_mode` field, which is not actually
`u32` on all systems, are examined.)1 parent f58f3ea commit 0becc91
File tree
3 files changed
+11
-1
lines changed- gix-worktree-state
- src/checkout
3 files changed
+11
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
| |||
0 commit comments