Stash modes corrupt binary files (0 bytes) on partial commits #743
Unanswered
alexey1312
asked this question in
Troubleshooting and Bug Reports
Replies: 1 comment
-
|
Related discussions: #209 (stash behavior issues) and #234 (RFC for transactional stash). This report adds a specific data-loss scenario where binary files become 0 bytes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Both
stash = "patch-file"andstash = "git"modes corrupt binary files (PNG, JPG) when committing with partial staged changes. Binary files in the unstaged area become 0 bytes after the stash/unstash cycle.Steps to Reproduce
Configure
hk.pklwith stash enabled:Stage a Swift file change:
Modify a binary file but do not stage it:
Verify state:
Commit:
git commit -m "test"Check the binary file:
Expected Behavior
The unstaged binary file should retain its contents after the commit (same md5/size as before).
Actual Behavior
The unstaged binary file becomes 0 bytes (completely destroyed). md5 becomes
d41d8cd98f00b204e9800998ecf8427e(empty file hash).Tested Stash Modes
"patch-file""git""none"Environment
.pngsnapshot test files in the working treeWorkaround
Using
stash = "none"avoids the issue, but linters then see unstaged changes too.Beta Was this translation helpful? Give feedback.
All reactions