Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-08-20 08:38:58 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-08-20 14:20:19 +0300
commit1184a055dea81ff9f2f72216823a87b8a003ae94 (patch)
treef9013f181b5b8516b1e49836371d03e5f9fdd0f2
parent489e4eace7fb09c42771e94e7fb2eee52f5de6c2 (diff)
Makefile: Inline check-mod-tidy
With PATH now containing a broken version of Git by design, we need to adjust all callers of Git to use the real executable instead of the broken one. The script `check-mod-tidy` is one of those which needs adjusting. Given it's such a tiny script, let's just inline it into our Makefile and have it use the `${GIT}` variable.
-rw-r--r--Makefile4
-rwxr-xr-x_support/check-mod-tidy19
2 files changed, 3 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index ca998c042..16d4d4415 100644
--- a/Makefile
+++ b/Makefile
@@ -205,7 +205,9 @@ verify: check-mod-tidy check-formatting notice-up-to-date check-proto rubocop
.PHONY: check-mod-tidy
check-mod-tidy:
- ${Q}${SOURCE_DIR}/_support/check-mod-tidy
+ ${Q}${GIT} diff --quiet --exit-code go.mod go.sum || (echo "error: uncommitted changes in go.mod or go.sum" && exit 1)
+ ${Q}go mod tidy
+ ${Q}${GIT} diff --quiet --exit-code go.mod go.sum || (echo "error: uncommitted changes in go.mod or go.sum" && exit 1)
.PHONY: lint
lint: ${GOLANGCI_LINT}
diff --git a/_support/check-mod-tidy b/_support/check-mod-tidy
deleted file mode 100755
index 2bce95221..000000000
--- a/_support/check-mod-tidy
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env ruby
-
-require_relative 'run.rb'
-
-def main
- mod_not_changed!
- run!(%w[go mod tidy])
- mod_not_changed!
-end
-
-def mod_not_changed!
- %w[go.mod go.sum].each do |f|
- unless system(*%W[git diff --quiet --exit-code #{f}])
- abort "error: uncommitted changes in #{f}"
- end
- end
-end
-
-main