File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,11 +169,13 @@ commit_msg_hook() {
169169# Scans all files that are about to be committed.
170170pre_commit_hook () {
171171 SCAN_CACHED=1
172- local file found_match=0 rev=" 4b825dc642cb6eb9a060e54bf8d69288fbee4904"
172+ local files=() file found_match=0 rev=" 4b825dc642cb6eb9a060e54bf8d69288fbee4904"
173173 # Diff against HEAD if this is not the first commit in the repo.
174174 git rev-parse --verify HEAD > /dev/null 2>&1 && rev=" HEAD"
175175 # Filter out deleted files using --diff-filter
176- readarray -t files <<< $( git diff-index --diff-filter ' ACMU' --name-only --cached $rev --)
176+ while IFS= read -r file; do
177+ files+=(" $file " )
178+ done <<< " $(git diff-index --diff-filter 'ACMU' --name-only --cached $rev --)"
177179 scan_with_fn_or_die " scan" " ${files[@]} "
178180}
179181
You can’t perform that action at this time.
0 commit comments