#!/bin/sh if git rev-parse --verify HEAD >/dev/null 2>&1 then against=HEAD else # Initial commit: diff against an empty tree object EMPTY_TREE=$(git hash-object -t tree /dev/null) against=$EMPTY_TREE fi # Redirect output to stderr. exec 1>&2 # Check changed files for an AWS keys FILES=$(git diff --cached --name-only $against) if [ -n "$FILES" ]; then KEY_ID=$(grep -E --line-number '[^A-Z0-9][A-Z0-