From 5433b88e2dbd43852a0f1f9625fefcf69a6ea688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Mon, 5 Jun 2023 16:31:15 +0200 Subject: [PATCH] hack/cli.sh: Quiet origin cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't show `error: No such remote: 'origin'` error when building for the first time and the cached git repository doesn't a remote yet. Signed-off-by: Paweł Gronowski --- hack/dockerfile/cli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/dockerfile/cli.sh b/hack/dockerfile/cli.sh index 6af829210a..f821994650 100755 --- a/hack/dockerfile/cli.sh +++ b/hack/dockerfile/cli.sh @@ -13,7 +13,7 @@ if curl --head --silent --fail "${DOWNLOAD_URL}" 1> /dev/null 2>&1; then mv docker/docker "${outdir}/docker" else git init -q . - git remote remove origin || true + git remote remove origin 2> /dev/null || true git remote add origin "${repository}" git fetch -q --depth 1 origin "${version}" +refs/tags/*:refs/tags/* git checkout -fq "${version}"