aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Spiers <github@adamspiers.org>2016-05-25 17:47:06 +0100
committerAdam Spiers <github@adamspiers.org>2016-05-25 17:47:06 +0100
commit1585048d503d295c4484ee5fec945a4c7841fb22 (patch)
tree67897940b88e6a21db76be8dfb0aa324b298e1d6
parentbd9ed690b5f8d30c58e8d5d08dea6cdf18eccd97 (diff)
parentc627b646bf401204f3e3ab72cb7053e89f25ab96 (diff)
downloadgit-deps-1585048d503d295c4484ee5fec945a4c7841fb22.tar.gz
Merge pull request #58 from Valodim/master
Account for Diff API changes in pygit2 version 0.22.1.
-rwxr-xr-xgit-deps.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/git-deps.py b/git-deps.py
index d28c85e..234d92a 100755
--- a/git-deps.py
+++ b/git-deps.py
@@ -420,7 +420,7 @@ class DependencyDetector(object):
diff = self.repo.diff(parent, dependent,
context_lines=self.options.context_lines)
for patch in diff:
- path = patch.old_file_path
+ path = patch.delta.old_file.path
self.logger.debug(" Examining hunks in %s" % path)
for hunk in patch.hunks:
self.blame_hunk(dependent, parent, path, hunk)
@@ -522,14 +522,14 @@ class DependencyDetector(object):
hunk_header = '@@ %s %s @@' % (line_range_before, line_range_after)
self.logger.debug(diff_format % ('--------', '-----', '', hunk_header))
line_num = hunk.old_start
- for mode, line in hunk.lines:
- if mode == '+':
+ for line in hunk.lines:
+ if line.origin == '+':
rev = ln = ''
else:
rev = line_to_culprit[line_num]
ln = line_num
line_num += 1
- self.logger.debug(diff_format % (rev, ln, mode, line.rstrip()))
+ self.logger.debug(diff_format % (rev, ln, line.origin, line.content.rstrip()))
def oneline(self, commit):
return commit.message.split('\n', 1)[0]