Skip to content

rename file got diff with change_type: R100 #563

Closed
@Thrimbda

Description

@Thrimbda

when I renamed file A to B like this

$ git mv A B
$ git status 
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   .gitmodules
	renamed:    A -> B
	modified:   Cprogramming

but using gitpython in ipython3 I got this:

In [135]: repo.commit('HEAD~2').diff(repo.head.commit)
Out[135]: 
[<git.diff.Diff at 0x7fc52ab13730>,
 <git.diff.Diff at 0x7fc529943c80>,
 <git.diff.Diff at 0x7fc529943d90>,
 <git.diff.Diff at 0x7fc52994ec80>]

In [136]: repo.commit('HEAD~2').diff(repo.head.commit)[2].b_path
Out[136]: 'Cprogramming'

In [137]: repo.commit('HEAD~2').diff(repo.head.commit)[1].b_path
Out[137]: 'B'

In [138]: repo.commit('HEAD~2').diff(repo.head.commit)[1].change_type
Out[138]: 'R100'

is that normal or something went wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions