spapas / python-git-info

A simple project to get information from the git repository of your project
https://pypi.org/project/python-git-info/
MIT License
28 stars 8 forks source link

UnboundLocalError when head_message_file does not exist #10

Closed goranbs closed 2 years ago

goranbs commented 3 years ago

For reasons unknown, head_message_file does not exist for a git-repo. This resulted in the following error:

File "gitinfo\gitinfo.py", line 101, in get_git_info
File "gitinfo\gitinfo.py", line 77, in get_git_info_dir
File "gitinfo\pack_reader.py", line 171, in get_pack_info
File "gitinfo\pack_reader.py", line 144, in get_object
File "gitinfo\pack_reader.py", line 95, in decode_delta
UnboundLocalError: local variable 'a' referenced before assignment
[16356] Failed to execute script due to unhandled exception!
spapas commented 3 years ago

Hello thank you for raising this. I am not sure what the correct behaviour should be here ... Is the repository you are using broken and we should handle the exception (so it won't throw but return an error message) or the file you mention may sometimes be normally missing and we need to work over that case?

Can you give me a link to the problematic repository so I could take a look?

spapas commented 2 years ago

Closing because of lack of activity from OP.