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

Pulls and pushes fail when diffed paths contains : because of a bug in gitpython #93

Closed
langfield opened this issue Sep 12, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@langfield
Copy link
Owner

See gitpython-developers/GitPython#1490.

Stack trace below.

ERROR:git.cmd:Pumping 'stdout' of cmd(['git', 'diff-tree', 'a31de9c31a0ee03574a34146aa1a986648ac499b', '7a62039cb6ce50e5d4c8fc412fdaf10e6f92b823', '-r', '--abbrev=40', '--full-index', '-M', '--raw', '-z', '--no-color']) failed due to: ValueError("invalid literal for int() with base 10: 'n'")
Exception in thread Thread-12:
Traceback (most recent call last):
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/cmd.py", line 114, in pump_stream
    handler(line)
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/diff.py", line 570, in <lambda>
    handle_process_output(proc, lambda byt: cls._handle_diff_line(byt, repo, index),
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/diff.py", line 557, in _handle_diff_line
    diff = Diff(repo, a_path, b_path, a_blob_id, b_blob_id, old_mode, new_mode,
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/diff.py", line 303, in __init__
    self.a_mode = mode_str_to_int(a_mode) if a_mode else None
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/objects/util.py", line 80, in mode_str_to_int
    mode += int(char) << iteration * 3
ValueError: invalid literal for int() with base 10: 'n'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/conda/envs/anki/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/home/user/conda/envs/anki/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/conda/envs/anki/lib/python3.9/site-packages/git/cmd.py", line 120, in pump_stream
    raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex
git.exc.CommandError: Cmd('<stdout-pump>') failed due to: ValueError('invalid literal for int() with base 10: 'n'')
  cmdline: <stdout-pump> git diff-tree a31de9c31a0ee03574a34146aa1a986648ac499b 7a62039cb6ce50e5d4c8fc412fdaf10e6f92b823 -r --abbrev=40 --full-index -M --raw -z --no-color

A temporary fix is just installing from a fork with the patch.

@langfield langfield added the bug Something isn't working label Sep 12, 2022
@langfield
Copy link
Owner Author

Fixed by #94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant