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

iter_change_type can't get the "M" type #493

Closed
@alexazhou

Description

@alexazhou

I have modify a file, use command "git status" can see it. but i can't use the iter_change_type of GitPython to find it out.

AlexaZhou$ git statusOn branch masterYour branch is up-to-date with 'origin/master'.Changes not staged for commit:  (use "git add <file>..." to update what will be committed)  (use "git checkout -- <file>..." to discard changes in working directory)    modified:   LICENSEAlexaZhou$AlexaZhou$

I can see it in the diff list, but can't get it from iter_change_type.

>>> repo = git.Repo('./')>>> diff = repo.index.diff(None)>>> >>> list( diff )[<git.diff.Diff object at 0x1030ad348>]>>> >>> list(diff.iter_change_type('A'))[]>>> list(diff.iter_change_type('D'))[]>>> list(diff.iter_change_type('R'))[]>>> list(diff.iter_change_type('M'))[]>>> >>> tmp = diff[0]>>> tmp.a_blob<git.Blob "65c5ca88a67c30becee01c5a8816d964b03862f9">>>> >>> tmp.b_blob>>> >>> tmp.b_blob == NoneTrue>>> >>>

when I use GitPython 1.0.1 it seems work right. But i can't work after i upgrede to GitPython 2.0.7

Help you can fix it.

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