aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
297 stars 46 forks source link

Error when fetching the dependencies of the root commit #125

Closed wetneb closed 9 months ago

wetneb commented 10 months ago

When fetching the dependencies of the root commit of a repository, I get the following error (on the git-deps repository):

Traceback (most recent call last):
  File "~/.venv/bin/git-deps", line 150, in <module>
    run()
  File "~/.venv/bin/git-deps", line 146, in run
    main(sys.argv[1:])
  File "~/bin/git-deps", line 140, in main
    cli(options, args)
  File "~/.venv/bin/git-deps", line 123, in cli
    detector.find_dependencies(rev)
  File "~/.venv/lib/python3.11/site-packages/git_deps-0.0.0-py3.11.egg/git_deps/detector.py", line 121, in find_dependencies
    parent = dependent.parents[0]
             ~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

While fetching the deps of the root commit isn't a fascinating endeavor, it is done indirectly when fetching dependencies recursively (with the -r flag) so it's worth making this doesn't fail.