summaryrefslogtreecommitdiff
path: root/git/test/test_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/test_diff.py')
-rw-r--r--git/test/test_diff.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index 136e6fd9..56e395fd 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -21,7 +21,8 @@ from git import (
Repo,
GitCommandError,
Diff,
- DiffIndex
+ DiffIndex,
+ NULL_TREE,
)
@@ -132,13 +133,13 @@ class TestDiff(TestBase):
initial_commit = self.rorepo.commit('33ebe7acec14b25c5f84f35a664803fcab2f7781')
# Without creating a patch...
- diff_index = initial_commit.diff('root')
+ diff_index = initial_commit.diff(NULL_TREE)
assert diff_index[0].b_path == 'CHANGES'
assert diff_index[0].new_file
assert diff_index[0].diff == ''
# ...and with creating a patch
- diff_index = initial_commit.diff('root', create_patch=True)
+ diff_index = initial_commit.diff(NULL_TREE, create_patch=True)
assert diff_index[0].b_path == 'CHANGES'
assert diff_index[0].new_file
assert diff_index[0].diff == fixture('diff_initial')
@@ -164,7 +165,7 @@ class TestDiff(TestBase):
diff_item = commit.tree
# END use tree every second item
- for other in (None, 'root', commit.Index, commit.parents[0]):
+ for other in (None, NULL_TREE, commit.Index, commit.parents[0]):
for paths in (None, "CHANGES", ("CHANGES", "lib")):
for create_patch in range(2):
diff_index = diff_item.diff(other=other, paths=paths, create_patch=create_patch)