Skip to content

Commit

Permalink
Fix pre-commit to exclude deleted files
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan O'Leary <ryanoleary@google.com>
  • Loading branch information
rjoleary authored and GanShun committed Aug 31, 2018
1 parent cd94a44 commit 8d0370b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e

echo "Running Pre-Commit"

FILES=`git diff --staged --name-only | grep '.*\.go' | cat`
FILES=`git diff --diff-filter=AM --staged --name-only | grep '.*\.go' | cat`

if [ -z "$FILES" ];
then
Expand Down

0 comments on commit 8d0370b

Please sign in to comment.