Skip to content

Add support for diffing against root commit #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 19, 2016
Prev Previous commit
Next Next commit
Perform diff-tree recursively to have the same output as diff
  • Loading branch information
nvie committed Apr 14, 2016
commit 28afef550371cd506db2045cbdd89d895bec5091
2 changes: 2 additions & 0 deletions git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
if other is self.Index:
args.insert(0, '--cached')
elif other is NULL_TREE:
args.insert(0, '-r') # recursive diff-tree
args.insert(0, '--root')
diff_cmd = self.repo.git.diff_tree
elif other is not None:
args.insert(0, '-r') # recursive diff-tree
args.insert(0, other)
diff_cmd = self.repo.git.diff_tree

Expand Down