Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitError raised on parsing a diff that has a filename with spaces #1260

Open
2bndy5 opened this issue Dec 23, 2023 · 1 comment
Open

GitError raised on parsing a diff that has a filename with spaces #1260

2bndy5 opened this issue Dec 23, 2023 · 1 comment

Comments

@2bndy5
Copy link

2bndy5 commented Dec 23, 2023

This was raised originally at cpp-linter/cpp-linter-action#178 in which a large diff was parsed by pygit2.Diff.parse_diff() (on ubuntu-latset CI github runner).

The error says:

pygit2.GitError: trailing data at line 3734

Here's the full diff: full_pr.diff.txt which was generated by github with the URL https://github.com/edunad/rawrbox/pull/108.diff

Line 3734 is

rename from render/content/fonts/SIL Open Font License.txt

I was able to reproduce this error locally on Windows. Is this expected behavior?

If I remove the spaces from the file name or put the entire path in quotes, then the diff is parsed without problem.

@2bndy5 2bndy5 changed the title GitError raised onparsing a diff that has a filename with spaces GitError raised on parsing a diff that has a filename with spaces Dec 23, 2023
@2bndy5
Copy link
Author

2bndy5 commented Dec 23, 2023

I tried to parse the diff in the rust binding git2-rs and got the same error, so I think this a problem with libgit2 C library itself.

This seems similar to libgit2/libgit2#5029 except the space is in a renamed filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant