Explorar o código

Fix git hooks

DarthSim %!s(int64=6) %!d(string=hai) anos
pai
achega
83c00a9e2b
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      .lefthook/pre-commit/lint
  2. 1 1
      .lefthook/pre-push/test

+ 1 - 1
.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

+ 1 - 1
.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