Repository navigation
Commit fcfbaa2
fix(index): preserve undecodable symlink target bytes
Staging a symbolic link decoded its target through `os.readlink()` and then
strictly re-encoded it. Targets containing undecodable filesystem bytes raised
`UnicodeEncodeError` instead of being stored as the link blob.
Use `os.fsencode()` to recover the original target bytes. Git's
`object-file.c` stores the bytes read from a symlink directly; the scripted
regression stages `../target-\xff` and verifies those exact object bytes.
The fixture executes at its final location because native fixture copying
follows symlinks.
The regression fails before the fix and passes on both backends. Connected
index tests pass on CLI and Gix; the combined Gix Diff/tree/index run passes
253 tests and nine subtests, with two platform skips. Ruff and ShellCheck pass.1 parent ae87bfb commit fcfbaa2
3 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
758 | | - | |
| 757 | + | |
759 | 758 | | |
760 | 759 | | |
761 | 760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments