From 631dec28ae4aa8e61d1bf8adb601eeecca694a49 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Thu, 28 May 2026 12:32:24 +0200 Subject: [PATCH] Re-apply edit in Makefile from #5079 to Taskfile --- Taskfile.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 7a8fb12ade..c19548c255 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -758,12 +758,20 @@ tasks: sh: echo "${UNIVERSE_DIR:-$HOME/universe}" cmds: - | - echo "Checking out universe at SHA: $(cat .codegen/_openapi_sha)" - cd {{.UNIVERSE_DIR}} - if ! git cat-file -e $(cat {{.ROOT_DIR}}/.codegen/_openapi_sha) 2>/dev/null; then - git fetch --filter=blob:none origin master + if [ -z "$UNIVERSE_SKIP_CHECKOUT" ]; then + if ! git -C {{.UNIVERSE_DIR}} diff --quiet || ! git -C {{.UNIVERSE_DIR}} diff --cached --quiet; then + echo "Error: universe repo at {{.UNIVERSE_DIR}} has uncommitted changes; commit or stash them, or set UNIVERSE_SKIP_CHECKOUT=1 to skip checkout" + exit 1 + fi + echo "Checking out universe at SHA: $(cat .codegen/_openapi_sha)" + cd {{.UNIVERSE_DIR}} + if ! git cat-file -e $(cat {{.ROOT_DIR}}/.codegen/_openapi_sha) 2>/dev/null; then + git fetch --filter=blob:none origin master + fi + git checkout $(cat {{.ROOT_DIR}}/.codegen/_openapi_sha) + else + echo "UNIVERSE_SKIP_CHECKOUT set; using current {{.UNIVERSE_DIR}} HEAD" fi - git checkout $(cat {{.ROOT_DIR}}/.codegen/_openapi_sha) - echo "Building genkit..." - cd {{.UNIVERSE_DIR}} && bazel build //openapi/genkit - echo "Generating CLI code..."