aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2016-07-03 09:15:09 -0600
committerAdam Spiers <git@adamspiers.org>2018-05-15 13:42:16 +0100
commit5d2d6a08865c71bd8cff2906d77b9c82bc1c6334 (patch)
tree2262d6e1b2f5a51874fc0543d9834152fc56237f
parent0aa44d5638ef72b1ca458355b5b4bf46438c5c56 (diff)
downloadgit-deps-5d2d6a08865c71bd8cff2906d77b9c82bc1c6334.tar.gz
allow DependencyDetector to be reused
Avoid any errors if find_dependencies() is called repeatedly. Previously this could fail when recursion was enabled, because a commit could be processed via recursion, and then again via a subsequent call to the TODO list, at which point the sanity check that each blame line hadn't been seen before would fail.
-rw-r--r--git_deps/detector.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/git_deps/detector.py b/git_deps/detector.py
index 25c9278..1c78a42 100644
--- a/git_deps/detector.py
+++ b/git_deps/detector.py
@@ -110,6 +110,12 @@ class DependencyDetector(object):
del self.todo_d[dependent_sha1]
self.logger.debug(" Processing %s from TODO list" %
dependent_sha1[:8])
+
+ if dependent_sha1 in self.done_d:
+ self.logger.debug(" %s already done previously" %
+ dependent_sha1)
+ continue
+
self.notify_listeners('new_commit', dependent)
for parent in dependent.parents: