From 83c00a9e2b16ea3d5731617de4d9472ccccfb4cc Mon Sep 17 00:00:00 2001 From: DarthSim Date: Mon, 16 Sep 2019 15:53:32 +0600 Subject: [PATCH] Fix git hooks --- .lefthook/pre-commit/lint | 2 +- .lefthook/pre-push/test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.lefthook/pre-commit/lint b/.lefthook/pre-commit/lint index bb8a241e..1d36d124 100755 --- a/.lefthook/pre-commit/lint +++ b/.lefthook/pre-commit/lint @@ -1,6 +1,6 @@ #!/bin/sh -if ! git diff --name-only | grep -qe ".*\.go$"; then +if ! git diff --staged --name-only | grep -qe ".*\.go$"; then echo "Nothing to lint" exit 0; fi diff --git a/.lefthook/pre-push/test b/.lefthook/pre-push/test index 6c99bec7..3b56c300 100755 --- a/.lefthook/pre-push/test +++ b/.lefthook/pre-push/test @@ -1,6 +1,6 @@ #!/bin/sh -if ! git diff --name-only | grep -qe ".*\.(go|h|c)$"; then +if ! git diff --staged --name-only | grep -qe ".*\.(go|h|c)$"; then echo "Nothing to test" exit 0; fi