summaryrefslogtreecommitdiff
path: root/lib/git_python/diff.py
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2008-05-20 15:56:38 +0200
committerFlorian Apolloner <florian@apolloner.eu>2008-05-20 15:56:38 +0200
commit35ddb45b41b3de2d4f783608ad8d8752f6557997 (patch)
treeaa5cc1acfcf65a4c7889846c227e85386090f719 /lib/git_python/diff.py
parent1dc09f0ece61ef2bd629e8bfe532aa24f4f8e0c2 (diff)
downloadgitpython-35ddb45b41b3de2d4f783608ad8d8752f6557997.tar.gz
removed unneeded spaces
Diffstat (limited to 'lib/git_python/diff.py')
-rw-r--r--lib/git_python/diff.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/git_python/diff.py b/lib/git_python/diff.py
index 185e1f57..075b0f87 100644
--- a/lib/git_python/diff.py
+++ b/lib/git_python/diff.py
@@ -5,12 +5,12 @@ class Diff(object):
"""
A Diff contains diff information between two commits.
"""
-
+
def __init__(self, repo, a_path, b_path, a_commit, b_commit, a_mode, b_mode, new_file, deleted_file, diff):
self.repo = repo
self.a_path = a_path
self.b_path = b_path
-
+
if not a_commit or re.search(r'^0{40}$', a_commit):
self.a_commit = None
else:
@@ -19,13 +19,13 @@ class Diff(object):
self.b_commit = None
else:
self.b_commit = commit.Commit(repo, **{'id': b_commit})
-
+
self.a_mode = a_mode
self.b_mode = b_mode
self.new_file = new_file
self.deleted_file = deleted_file
self.diff = diff
-
+
@classmethod
def list_from_string(cls, repo, text):
lines = text.splitlines()
@@ -46,10 +46,10 @@ class Diff(object):
if re.search(r'^diff --git', lines[0]):
diffs.append(Diff(repo, a_path, b_path, None, None, a_mode, b_mode, False, False, None))
continue
-
+
new_file = False
deleted_file = False
-
+
if re.search(r'^new file', lines[0]):
m = re.search(r'^new file mode (.+)', lines.pop(0))
if m:
@@ -62,18 +62,18 @@ class Diff(object):
a_mode, = m.groups()
b_mode = None
deleted_file = True
-
+
m = re.search(r'^index ([0-9A-Fa-f]+)\.\.([0-9A-Fa-f]+) ?(.+)?$', lines.pop(0))
if m:
a_commit, b_commit, b_mode = m.groups()
if b_mode:
b_mode = b_mode.strip()
-
+
diff_lines = []
while lines and not re.search(r'^diff', lines[0]):
diff_lines.append(lines.pop(0))
-
+
diff = "\n".join(diff_lines)
diffs.append(Diff(repo, a_path, b_path, a_commit, b_commit, a_mode, b_mode, new_file, deleted_file, diff))
-
- return diffs \ No newline at end of file
+
+ return diffs