Ignore deleted files in pre-commit hook

This commit is contained in:
Marko Korhonen 2022-09-16 20:12:25 +03:00
parent d1dff202c9
commit 9b8581051e
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890

View file

@ -8,7 +8,7 @@ echo "FunctionalHacker's dotfile pre-commit hook start"
printf "Using shell: %s \n" "$(readlink /proc/$$/exe)"
# All staged files
staged_files=$(git diff --name-only --cached)
staged_files=$(git diff --name-only --cached --diff-filter=d)
# Run taplo on staged TOML files
staged_toml=$(echo "$staged_files" | grep '.toml$' || true)