1
0
forked from clan/clan-core

pre-commit: fix weird bug where commit_files is undefined in bash

This commit is contained in:
Jörg Thalheim 2023-08-09 15:16:35 +02:00
parent 6c169b0bed
commit caa1c0dfd8

View File

@ -18,7 +18,7 @@ log() {
}
# If the commit has no files, skip everything as there is nothing to format
if [[ ${#commit_files} = 0 ]]; then
if [[ -z ${commit_files+x} ]] || [[ ${#commit_files} = 0 ]]; then
log "no files to format"
exit 0
fi