Skip to content

Commit 9a9d995

Browse files
author
Sze Siong Teo
authored
Fix for pre-commit hook failure on bash 4
This PR fixes the issue described here. awslabs/git-secrets#45 (comment)
1 parent b10e08e commit 9a9d995

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

git-secrets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ scan_history() {
102102
# Looks for differences matching the patterns, reduces the number of revisions to scan
103103
local to_scan=$(git log --all -G"${combined_patterns}" --pretty=%H)
104104
# Scan through revisions with findings to normalize output
105-
output=$(git_grep "" "${to_scan}")
105+
output=$(GREP_OPTIONS= LC_ALL=C git grep -nwHEI "${combined_patterns}" $to_scan)
106106
process_output $? "${output}"
107107
}
108108

@@ -112,7 +112,7 @@ git_grep() {
112112
local options="$1"; shift
113113
local files=$@ combined_patterns=$(load_combined_patterns)
114114
[ -z "${combined_patterns}" ] && return 1
115-
GREP_OPTIONS= LC_ALL=C git grep -nwHEI ${options} "${combined_patterns}" $files
115+
GREP_OPTIONS= LC_ALL=C git grep -nwHEI ${options} "${combined_patterns}" -- $files
116116
}
117117

118118
# Performs a regular grep, taking into account patterns and recursion.

0 commit comments

Comments
 (0)