21
21
Repo ,
22
22
GitCommandError ,
23
23
Diff ,
24
- DiffIndex
24
+ DiffIndex ,
25
+ NULL_TREE ,
25
26
)
26
27
27
28
@@ -132,13 +133,13 @@ def test_diff_initial_commit(self):
132
133
initial_commit = self .rorepo .commit ('33ebe7acec14b25c5f84f35a664803fcab2f7781' )
133
134
134
135
# Without creating a patch...
135
- diff_index = initial_commit .diff ('root' )
136
+ diff_index = initial_commit .diff (NULL_TREE )
136
137
assert diff_index [0 ].b_path == 'CHANGES'
137
138
assert diff_index [0 ].new_file
138
139
assert diff_index [0 ].diff == ''
139
140
140
141
# ...and with creating a patch
141
- diff_index = initial_commit .diff ('root' , create_patch = True )
142
+ diff_index = initial_commit .diff (NULL_TREE , create_patch = True )
142
143
assert diff_index [0 ].b_path == 'CHANGES'
143
144
assert diff_index [0 ].new_file
144
145
assert diff_index [0 ].diff == fixture ('diff_initial' )
@@ -164,7 +165,7 @@ def test_diff_interface(self):
164
165
diff_item = commit .tree
165
166
# END use tree every second item
166
167
167
- for other in (None , 'root' , commit .Index , commit .parents [0 ]):
168
+ for other in (None , NULL_TREE , commit .Index , commit .parents [0 ]):
168
169
for paths in (None , "CHANGES" , ("CHANGES" , "lib" )):
169
170
for create_patch in range (2 ):
170
171
diff_index = diff_item .diff (other = other , paths = paths , create_patch = create_patch )
0 commit comments