pre-commit: fix weird bug where commit_files is undefined in bash
This commit is contained in:
@@ -18,7 +18,7 @@ log() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# If the commit has no files, skip everything as there is nothing to format
|
# 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"
|
log "no files to format"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user