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

Ignore empty info in diff line #1497

Merged
merged 1 commit into from Sep 27, 2022

Conversation

dwapstra
Copy link
Contributor

In some cases, the git diff command does not return any output, this results in an exception in the diff line handling code.

  File "../lib/python3.8/site-packages/git/diff.py", line 502, in _handle_diff_line
    old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4)
ValueError: not enough values to unpack (expected 5, got 1)

This fix ignores empty diff lines.

@Byron Byron added this to the v3.1.28 - Bugfixes milestone Sep 27, 2022
@Byron
Copy link
Member

Byron commented Sep 27, 2022

Thanks a lot. This is probably an example for 'the perfect PR': Bite-sized, with concise description, and CI is happy, too :).

@Byron Byron merged commit 0d28eaa into gitpython-developers:main Sep 27, 2022
@dwapstra dwapstra deleted the git_diff_empty branch September 28, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants