Open
Description
When I do this:
>>> import git
>>> r = git.Repo('.')
>>> from pprint import pprint
>>> pprint(r.active_branch.commit.diff('master', create_patch=True)[0].diff.decode('utf-8').split('\n'))
Then I see the same first file as when I do git diff master
in the terminal. But, it gets the "+" and "-" backwards. In python I see lines such as:
...
'-import static org.mockito.Matchers.anyLong;',
'-import static org.mockito.Matchers.anyString;',
'-import static org.mockito.Mockito.times;',
...
But this is a file I've added in the active branch that isn't in the master! In the terminal when I do git diff master
I see:
...
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.times;
...
On the other hand, when I use pprint(r.git.diff('master').split('\n'))
then I get the right result:
...
'+import static org.mockito.Matchers.anyLong;',
'+import static org.mockito.Matchers.anyString;',
'+import static org.mockito.Mockito.times;',
...