Skip to content

Store path attribute on Diff object #266

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 1 commit into from
Mar 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ class Diff(object):

a_mode is None
a_blob is None
a_path is None

``Deleted File``::

b_mode is None
b_blob is None
b_path is None

``Working Tree Blobs``

Expand Down Expand Up @@ -200,8 +202,8 @@ class Diff(object):
NULL_HEX_SHA = "0" * 40
NULL_BIN_SHA = b"\0" * 20

__slots__ = ("a_blob", "b_blob", "a_mode", "b_mode", "new_file", "deleted_file",
"rename_from", "rename_to", "diff")
__slots__ = ("a_blob", "b_blob", "a_mode", "b_mode", "a_path", "b_path",
"new_file", "deleted_file", "rename_from", "rename_to", "diff")

def __init__(self, repo, a_path, b_path, a_blob_id, b_blob_id, a_mode,
b_mode, new_file, deleted_file, rename_from,
Expand All @@ -210,6 +212,9 @@ def __init__(self, repo, a_path, b_path, a_blob_id, b_blob_id, a_mode,
self.a_mode = a_mode
self.b_mode = b_mode

self.a_path = a_path
self.b_path = b_path

if self.a_mode:
self.a_mode = mode_str_to_int(self.a_mode)
if self.b_mode:
Expand Down