aboutsummaryrefslogtreecommitdiffstats
path: root/git_deps
diff options
context:
space:
mode:
authorAntonin Delpeuch <antonin@delpeuch.eu>2023-09-20 10:45:10 +0200
committerAntonin Delpeuch <antonin@delpeuch.eu>2023-09-22 13:32:26 +0200
commita31c37c07ba6ccd093961fb5b7aec252f2851008 (patch)
tree8cc9d333b7987f0ae23c912c1a43dfce59f5d3ca /git_deps
parent669a4cbf3580d6300a32391a634c3d10b4e3432a (diff)
downloadgit-deps-a31c37c07ba6ccd093961fb5b7aec252f2851008.tar.gz
Fix deps fetching on the root commit
Closes #125.
Diffstat (limited to 'git_deps')
-rw-r--r--git_deps/detector.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git_deps/detector.py b/git_deps/detector.py
index ce73762..1836a56 100644
--- a/git_deps/detector.py
+++ b/git_deps/detector.py
@@ -118,8 +118,10 @@ class DependencyDetector(object):
self.notify_listeners('new_commit', dependent)
- parent = dependent.parents[0]
- self.find_dependencies_with_parent(dependent, parent)
+ if dependent.parents: # the root commit does not have parents
+ parent = dependent.parents[0]
+ self.find_dependencies_with_parent(dependent, parent)
+
self.done.append(dependent_sha1)
self.done_d[dependent_sha1] = True
self.logger.info(" Found all dependencies for %s" %