Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty tree in a commit causes a crash #9

Open
slarse opened this issue Nov 15, 2019 · 1 comment
Open

Empty tree in a commit causes a crash #9

slarse opened this issue Nov 15, 2019 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@slarse
Copy link
Owner

slarse commented Nov 15, 2019

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 slarse added the bug Something isn't working label Nov 15, 2019
@slarse slarse changed the title Empty commits causes a crash Empty tree in a commit causes a crash Apr 29, 2022
@slarse
Copy link
Owner Author

slarse commented Apr 29, 2022

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

@slarse slarse added the good first issue Good for newcomers label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant