Skip to content

Commit

Permalink
Fix for pre-commit hook failure on bash 4
Browse files Browse the repository at this point in the history
This PR fixes the issue described here.
awslabs#45 (comment)
  • Loading branch information
Sze Siong Teo committed Sep 8, 2017
1 parent b10e08e commit 9a9d995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ scan_history() {
# Looks for differences matching the patterns, reduces the number of revisions to scan
local to_scan=$(git log --all -G"${combined_patterns}" --pretty=%H)
# Scan through revisions with findings to normalize output
output=$(git_grep "" "${to_scan}")
output=$(GREP_OPTIONS= LC_ALL=C git grep -nwHEI "${combined_patterns}" $to_scan)
process_output $? "${output}"
}

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

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

0 comments on commit 9a9d995

Please sign in to comment.