Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where colons in paths raise a
ValueError
on diff()
calls.
This commit introduces a potential fix for #1490 and #1483, in which an `invalid literal for int() with base 10: 'n'` exception was raised within a diff operation. Within `_handle_diff_line()`, we split the output of `git diff-tree` on colons (`:` characters), under the assumption that there are no colons within the paths of the files being diffed. On POSIX systems this is not a valid assumption. The fix is to split on `\x00:`, since a null character always precedes the colons we actually need to split on. A test already existed for this case (`test_diff_file_with_colon()`), but it was marked as skipped. * Split on `\x00:` instead of `:` in `_handle_diff_line()`. * Unskip `test_diff_file_with_colon()`.
- Loading branch information