Closed acesyde closed 2 years ago
Hi, thanks! I think this way we lose task action on the first commit which is not ideal. should be a better way to handle this. 🤔 we need to prevent the exception also do the task action on the first commit.
You're right i will check that ;)
@alirezanet I checked how pre-commit fetches staged files
They use this command
https://github.com/pre-commit/pre-commit/blob/e0e536b54e1d7abcea477ad74e2b738fec0b35b0/pre_commit/git.py#L127
git diff --staged --name-only --no-ext-diff --diff-filter=ACMRTUXB
And it works fine with that
Look's fine if it solves the problem. I need a little bit of time to manually test this. thanks
Description
Fixed first commit when current git repository contains no commits
Fixes # (issue)
27
Type of change
Checklist