From be26ec6df0c55794607e18d2685f57e653e146da Mon Sep 17 00:00:00 2001 From: Predrag Knezevic Date: Fri, 12 Jun 2026 16:06:29 +0200 Subject: [PATCH] fix: allow api-lint-diff to run from a git worktree In a git worktree `.git` is a file (not a directory), so the `-d` test always fails. Switch to `-e` which checks for existence regardless of type. Co-Authored-By: Claude --- hack/api-lint-diff/run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/api-lint-diff/run.sh b/hack/api-lint-diff/run.sh index 8fd02a6a68..75b422cb95 100755 --- a/hack/api-lint-diff/run.sh +++ b/hack/api-lint-diff/run.sh @@ -30,8 +30,9 @@ cleanup() { trap cleanup EXIT -# Ensure we're in the repository root -if [[ ! -d ".git" ]]; then +# Ensure we're in the repository root (.git is a directory in a regular +# checkout but a file in a worktree, so test existence rather than type) +if [[ ! -e ".git" ]]; then echo -e "${RED}Error: Must be run from repository root${NC}" exit 1 fi