Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Assertion Error when "diffing" index during cherry pick conflict. #323

Closed
@Agecaf

Description

@Agecaf

I am trying to use gitpython to make a tool for helping in cherry-picking. The "repo.git.cherry_pick('hexsha')" command works perfectly, but, when I want to check the files with conflicts via

repo.index.diff(None)

I get the following Assertion Error;

Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "C:\Python27\lib\site-packages\git\index\util.py", line 69, in check_default_index    return func(self, *args, **kwargs)  File "C:\Python27\lib\site-packages\git\index\base.py", line 1197, in diff    return super(IndexFile, self).diff(other, paths, create_patch, **kwargs)  File "C:\Python27\lib\site-packages\git\diff.py", line 109, in diff    index = diff_method(self.repo, proc.stdout)  File "C:\Python27\lib\site-packages\git\diff.py", line 391, in _index_from_raw_format    new_file, deleted_file, rename_from, rename_to, '')  File "C:\Python27\lib\site-packages\git\diff.py", line 226, in __init__    assert self.a_modeAssertionError

Similarly, when comparing with head,

repo.index.diff('HEAD')

I get a slightly different error (a_mode -> b_mode);

Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "C:\Python27\lib\site-packages\git\index\util.py", line 69, in check_default_index    return func(self, *args, **kwargs)  File "C:\Python27\lib\site-packages\git\index\base.py", line 1189, in diff    return other.diff(self.Index, paths, create_patch, **kwargs)  File "C:\Python27\lib\site-packages\git\diff.py", line 109, in diff    index = diff_method(self.repo, proc.stdout)  File "C:\Python27\lib\site-packages\git\diff.py", line 391, in _index_from_raw_format    new_file, deleted_file, rename_from, rename_to, '')  File "C:\Python27\lib\site-packages\git\diff.py", line 231, in __init__    assert self.b_modeAssertionError

I'll be using the items with status non 0 in the index as a workaround for now (there are three per item with conflict).

Just for completeness, "diffing" works perfectly fine when not in cherry-picking conflict resolution (I tested it in the same session as the one that produced the errors).

Regards,
Agecaf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp