From e6c01f672b09f53aa161f407e81d4aacfc1c449e Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 11 Sep 2018 09:24:58 -0600 Subject: fix undefined parent variable bug This was introduced by recent refactoring which split blame_hunk() into several smaller methods. --- git_deps/detector.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'git_deps') diff --git a/git_deps/detector.py b/git_deps/detector.py index 4b0af89..8e977cc 100644 --- a/git_deps/detector.py +++ b/git_deps/detector.py @@ -171,13 +171,13 @@ class DependencyDetector(object): line_to_culprit = {} for line in blame.split('\n'): - self.process_hunk_line(dependent, dependent_sha1, + self.process_hunk_line(dependent, dependent_sha1, parent, path, line, line_to_culprit) self.debug_hunk(line_range_before, line_range_after, hunk, line_to_culprit) - def process_hunk_line(self, dependent, dependent_sha1, + def process_hunk_line(self, dependent, dependent_sha1, parent, path, line, line_to_culprit): self.logger.debug(" ! " + line.rstrip()) m = re.match('^([0-9a-f]{40}) (\d+) (\d+)( \d+)?$', line) @@ -201,7 +201,8 @@ class DependencyDetector(object): dependency, dependency_sha1, path, line_num) - self.record_dependency_source(dependent, dependent_sha1, + self.record_dependency_source(parent, + dependent, dependent_sha1, dependency, dependency_sha1, path, line_num, line) @@ -280,7 +281,8 @@ class DependencyDetector(object): self.logger.info(" + Added %s to TODO" % dependency.hex[:8]) - def record_dependency_source(self, dependent, dependent_sha1, + def record_dependency_source(self, parent, + dependent, dependent_sha1, dependency, dependency_sha1, path, line_num, line): dep_sources = self.dependencies[dependent_sha1][dependency_sha1] -- cgit