From bd5d787a3b90bfa2f9c0879d42455ef560448d06 Mon Sep 17 00:00:00 2001 From: Sal Date: Sat, 29 Aug 2026 02:10:17 +0100 Subject: [PATCH] fix(trunk): anchor git-diff-check at the workspace root git-diff-check invoked `git diff --check ${target}` from Trunk's sandbox copy of the target. This repository is consumed as a submodule, so its `.git` is a file whose gitdir is relative to the superproject. The sandbox copy invalidates that relative path and every run failed with: fatal: not a git repository: (null) Anchor the command at ${workspace} so repository discovery resolves against the real checkout instead of the sandbox directory. Verified: `trunk check --no-fix --ci --filter=git-diff-check` reports "No issues" where it previously exited 128. --- .trunk/trunk.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 7cdfae6..686c010 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -13,6 +13,13 @@ repo: name: src lint: definitions: + # This repository is consumed as a submodule, so `.git` is a file whose + # gitdir is relative to the superproject. Trunk's sandbox copy breaks that + # relative path, so anchor the command at the real workspace. + - name: git-diff-check + commands: + - name: lint + run: git -C "${workspace}" diff --check ${target} - name: shfmt commands: - name: format