Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Open
Labels
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 dogit 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 dogit 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 usepprint(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;',...