From f713233eee9143d0a798976fd0d11609f91c0b5c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 23 Oct 2026 03:47:21 +0000 Subject: fix(codex): accept linked git worktrees as checkouts package-codex-plugin.sh and sync-to-codex-plugin.sh checked for a checkout with [[ -d .git ]]. In a linked worktree .git is a file, so both scripts died with "not a git checkout" there, and tests/codex/test-package-codex-plugin.sh failed 9 checks when run from any worktree. Test that .git exists instead: it covers both layouts and still requires the path to be the root of a checkout, which matters for sync's user-supplied --local path. The scripts' later git commands already work in worktrees. Regression tests run the package script from a linked worktree of the repo, and a sync preview from a linked upstream worktree into a linked destination worktree. The package test is adapted from #1910. Co-authored-by: tianma-if Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba --- scripts/package-codex-plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/package-codex-plugin.sh') diff --git a/scripts/package-codex-plugin.sh b/scripts/package-codex-plugin.sh index 5308e28..fe90862 100755 --- a/scripts/package-codex-plugin.sh +++ b/scripts/package-codex-plugin.sh @@ -140,7 +140,7 @@ if [[ "$FORMAT" == "zip" ]]; then command -v unzip >/dev/null || die "unzip not found in PATH" fi -[[ -d "$REPO_ROOT/.git" ]] || die "repo root is not a git checkout: $REPO_ROOT" +[[ -e "$REPO_ROOT/.git" ]] || die "repo root is not a git checkout: $REPO_ROOT" git -C "$REPO_ROOT" rev-parse --verify "$REF^{commit}" >/dev/null || die "git ref does not resolve to a commit: $REF" -- cgit