From cc05ade4f72238d7bf2f4b229377ba23dc6904ee Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Thu, 1 Jun 2023 12:43:27 +0200 Subject: [PATCH] Utilize native git diff feature This `--exit-code` option does exactly what the script is doing Signed-off-by: Marco Franssen --- Makefile | 10 +++++----- scripts/git-diff | 7 ------- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100755 scripts/git-diff diff --git a/Makefile b/Makefile index d8b41a4bf7..2c4f5f5ff4 100644 --- a/Makefile +++ b/Makefile @@ -100,23 +100,23 @@ bin/protoc-gen-go-grpc: ##@ Verify verify: generate ## Verify that all the code was generated and committed to repository. - @./scripts/git-diff + @git diff --exit-code .PHONY: verify-proto verify-proto: generate-proto ## Verify that the Dex client's protobuf code was generated. - @./scripts/git-diff + @git diff --exit-code .PHONY: verify-proto verify-proto-internal: generate-proto-internal ## Verify internal protobuf code for token encoding was generated. - @./scripts/git-diff + @git diff --exit-code .PHONY: verify-ent verify-ent: generate-ent ## Verify code for database ORM was generated. - @./scripts/git-diff + @git diff --exit-code .PHONY: verify-go-mod verify-go-mod: go-mod-tidy ## Check that go.mod and go.sum formatted according to the changes. - @./scripts/git-diff + @git diff --exit-code ##@ Test and Lint diff --git a/scripts/git-diff b/scripts/git-diff deleted file mode 100755 index 302ac2ce3e..0000000000 --- a/scripts/git-diff +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -DIFF=$( git diff . ) -if [ "$DIFF" != "" ]; then - echo "$DIFF" >&2 - exit 1 -fi