diff options
author | Vincent Driessen <me@nvie.com> | 2016-04-14 15:55:21 +0200 |
---|---|---|
committer | Vincent Driessen <me@nvie.com> | 2016-04-14 15:56:13 +0200 |
commit | 1875885485e7c78d34fd56b8db69d8b3f0df830c (patch) | |
tree | 465efcefe87d406e72c06996cbedf7b4289caef6 /git/test/test_diff.py | |
parent | c042f56fc801235b202ae43489787a6d479cd277 (diff) | |
download | gitpython-1875885485e7c78d34fd56b8db69d8b3f0df830c.tar.gz |
Fix test cases
Diffstat (limited to 'git/test/test_diff.py')
-rw-r--r-- | git/test/test_diff.py | 9 |
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) |