Skip to content

'Tree' object has no attribute #66

Closed
@hsellik

Description

@hsellik

Describe the bug:
Trying to analyze a git repository which was ported from SVN.

To Reproduce:
Running very simple code on repo (which should not produce any errors?):

for commit in RepositoryMining("repo/path").traverse_commits():
    for modification in commit.modifications:
        print(" with a change type of {}".format(modification.complexity))

OS Version:
MacOS

PyDriller Version:
1.9.2

Logs:

Traceback (most recent call last):
  File ".../Library/Application Support/IntelliJIdea2019.2/python/helpers/pydev/pydevd.py", line 1415, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "...//Library/Application Support/IntelliJIdea2019.2/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File ".../repo_analyzer.py", line 13, in <module>
    for m in commit.modifications:
  File “.../lib/python3.7/site-packages/pydriller/domain/commit.py", line 377, in modifications
    self._modifications = self._get_modifications()
  File “.../lib/python3.7/site-packages/pydriller/domain/commit.py", line 388, in _get_modifications
    create_patch=True)
  File “.../lib/python3.7/site-packages/git/diff.py", line 152, in diff
    index = diff_method(self.repo, proc)
  File “.../lib/python3.7/site-packages/git/diff.py", line 470, in _index_from_patch_format
    None, None, None))
  File “.../lib/python3.7/site-packages/git/diff.py", line 284, in __init__
    for submodule in repo.submodules:
  File “.../lib/python3.7/site-packages/git/repo/base.py", line 340, in submodules
    return Submodule.list_items(self)
  File “.../lib/python3.7/site-packages/git/util.py", line 928, in list_items
    out_list.extend(cls.iter_items(repo, *args, **kwargs))
  File “.../lib/python3.7/site-packages/git/objects/submodule/base.py", line 1192, in iter_items
    sm._name = n
AttributeError: 'Tree' object has no attribute '_name'

Any idea what could be the issue here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions