crates/git/src/commit.rs 🔗
Alvaro Parker created
When working on the git stash picker PR (#35927) I notice that my test
was detected as a binary file on the git diff view and on GitHub. This
was due to the fact that I was using the literal char \0 (instead of a
proper representation like `\x00` or `\u{0000}`) character in my test
strings. This causes problems with git diff and GitHub's diff viewer,
and a reviewer might even assume that the file is corrupted, not
viewable or even malicious.
Looking at the rest of the codebase, only at `crates/git/src/commit.rs`
this character was used, so I replaced it with `\x00` which is a more
common representation of the null character in Rust strings.
It can also be seen that the PR that introduced this code, can't be
viewed properly on Github:
https://github.com/zed-industries/zed/pull/27636/files#diff-31114f0b22306b467482573446f71c638277510b442a10e60dd9a8667ccd93c3
Closes #ISSUE
Release Notes:
- Use `\x00` representation instead of literal null character in strings
to improve compatibility with git diff and GitHub's diff viewer.
Since the file is not viewable from the "Files changed" tab on Github,
this is the changed code:
https://github.com/zed-industries/zed/blob/dcd743aca494ec0217a2d7751150ca9e456012f4/crates/git/src/commit.rs#L66-L74
crates/git/src/commit.rs | 0
1 file changed