From 354abbcb92cb31ce15d02eaa03f178a8d7dfb7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Thu, 6 Nov 2025 23:42:03 +0100 Subject: [PATCH] hack/vendor: Allow to specify ref to dropreplace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- hack/vendor.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hack/vendor.sh b/hack/vendor.sh index 61fc0d8524..00e31b21be 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -42,15 +42,21 @@ replace() ( dropreplace() ( set -x + ref=$1 + if [ -z "$ref" ]; then + ref=master + fi + + ref=$(git rev-parse "$ref") go mod edit -dropreplace=github.com/moby/moby/api -dropreplace=github.com/moby/moby/client go mod edit -modfile client/go.mod -dropreplace=github.com/moby/moby/api - go mod edit -modfile client/go.mod -require='github.com/moby/moby/api@master' + go mod edit -modfile client/go.mod -require="github.com/moby/moby/api@$ref" (cd client; go mod tidy) go mod edit \ - -require='github.com/moby/moby/api@master' \ - -require='github.com/moby/moby/client@master' + -require="github.com/moby/moby/api@$ref" \ + -require="github.com/moby/moby/client@$ref" go mod tidy go mod vendor ) @@ -69,7 +75,7 @@ case "$1" in tidy) tidy ;; vendor) vendor ;; replace) replace ;; - dropreplace) dropreplace ;; + dropreplace) dropreplace "$2" ;; ""|all) tidy && vendor ;; *) help ;; esac