Skip to content

Commit 88f3dc2

Browse files
committed
Merge pull request #266 from jeblair/master
Store path attribute on Diff object
2 parents a5e607e + 50f763c commit 88f3dc2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git/diff.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,13 @@ class Diff(object):
168168
169169
a_mode is None
170170
a_blob is None
171+
a_path is None
171172
172173
``Deleted File``::
173174
174175
b_mode is None
175176
b_blob is None
177+
b_path is None
176178
177179
``Working Tree Blobs``
178180
@@ -200,8 +202,8 @@ class Diff(object):
200202
NULL_HEX_SHA = "0" * 40
201203
NULL_BIN_SHA = b"\0" * 20
202204

203-
__slots__ = ("a_blob", "b_blob", "a_mode", "b_mode", "new_file", "deleted_file",
204-
"rename_from", "rename_to", "diff")
205+
__slots__ = ("a_blob", "b_blob", "a_mode", "b_mode", "a_path", "b_path",
206+
"new_file", "deleted_file", "rename_from", "rename_to", "diff")
205207

206208
def __init__(self, repo, a_path, b_path, a_blob_id, b_blob_id, a_mode,
207209
b_mode, new_file, deleted_file, rename_from,
@@ -210,6 +212,9 @@ def __init__(self, repo, a_path, b_path, a_blob_id, b_blob_id, a_mode,
210212
self.a_mode = a_mode
211213
self.b_mode = b_mode
212214

215+
self.a_path = a_path
216+
self.b_path = b_path
217+
213218
if self.a_mode:
214219
self.a_mode = mode_str_to_int(self.a_mode)
215220
if self.b_mode:

0 commit comments

Comments
 (0)