Skip to content

Commit 7c46b5d

Browse files
denikclaude
andauthored
make generate: skip fetch if commit already exists locally (#4668)
## Why Reduce time "make generate" takes to fetch the commit from 70s to 0.5s. ## Tests Manually running "make generate". Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8c146f8 commit 7c46b5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ GENKIT_BINARY := $(UNIVERSE_DIR)/bazel-bin/openapi/genkit/genkit_/genkit
176176

177177
generate:
178178
@echo "Checking out universe at SHA: $$(cat .codegen/_openapi_sha)"
179-
cd $(UNIVERSE_DIR) && git fetch origin master && git checkout $$(cat $(PWD)/.codegen/_openapi_sha)
179+
cd $(UNIVERSE_DIR) && git cat-file -e $$(cat $(PWD)/.codegen/_openapi_sha) 2>/dev/null || git fetch --filter=blob:none origin master && git checkout $$(cat $(PWD)/.codegen/_openapi_sha)
180180
@echo "Building genkit..."
181181
cd $(UNIVERSE_DIR) && bazel build //openapi/genkit
182182
@echo "Generating CLI code..."

0 commit comments

Comments
 (0)