← 返回首页
iter_change_type can't get the "M" type · Issue #493 · gitpython-developers/GitPython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

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

New issue
New issue

Description

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 status On branch master Your 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: LICENSE AlexaZhou$ 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 == None True >>> >>>

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
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.