slarse / pygitviz

A tool for visualizing Git repositories
MIT License
7 stars 0 forks source link

Empty tree in a commit causes a crash #9

Open slarse opened 4 years ago

slarse commented 4 years ago

The function that parses trees tries to unpack each line into three values, but empty trees will be pretty empty so there's a crash.

slarse commented 2 years ago

To be clear, this is only a problem if one makes an empty commit when the repo has no content in the previous commit. Can be easily reproduced by creating an empty commit as the first commit:

git init
git commit --allow-empty -m 'Empty commit'  # Creates a commit with an empty root tree