diff options
| author | Fernando Serboncini <fserb@tailscale.com> | 2026-04-21 11:42:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 11:42:53 -0400 |
| commit | 1669b0d3d48310e970fb55460af34527d7bde602 (patch) | |
| tree | 5c19ddf74ccb39306687759c77758da5100e59f8 | |
| parent | 1e68a11721fd59408b68bce8be47ef77e3776572 (diff) | |
| download | tailscale-1669b0d3d48310e970fb55460af34527d7bde602.tar.xz tailscale-1669b0d3d48310e970fb55460af34527d7bde602.zip | |
misc/git_hook: fix building git_hook in a nested worktree (#19473)
When the repo is checked out as a nested worktree, a go.work in the
outer tree hijacks module resolution, which makes the rebuild fails
with "main module does not contain package." Set GOWORK=off for the
build since the hook is self-contained.
Bumps HOOK_VERSION so existing installs pick up the fix.
Updates #cleanup
Change-Id: Ibd14849efc26e4e1893c5b8e300caa71573f54bd
Signed-off-by: Fernando Serboncini <fserb@fserb.com.br>
| -rw-r--r-- | misc/git_hook/HOOK_VERSION | 2 | ||||
| -rwxr-xr-x | misc/git_hook/githook/launcher.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/misc/git_hook/HOOK_VERSION b/misc/git_hook/HOOK_VERSION index 0cfbf0888..00750edc0 100644 --- a/misc/git_hook/HOOK_VERSION +++ b/misc/git_hook/HOOK_VERSION @@ -1 +1 @@ -2 +3 diff --git a/misc/git_hook/githook/launcher.sh b/misc/git_hook/githook/launcher.sh index 8a6d00885..1171bc7b1 100755 --- a/misc/git_hook/githook/launcher.sh +++ b/misc/git_hook/githook/launcher.sh @@ -36,7 +36,7 @@ if [ "$WANT" != "$HAVE" ]; then GO="$REPO_ROOT/tool/go$EXE" if [ ! -x "$GO" ]; then GO=go; fi echo "git-hook: rebuilding ts-git-hook-bin..." >&2 - (cd "$REPO_ROOT" && "$GO" build -o "$BINARY" ./misc/git_hook) || { + (cd "$REPO_ROOT" && GOWORK=off "$GO" build -o "$BINARY" ./misc/git_hook) || { echo "git-hook: rebuild failed, run: ./tool/go run ./misc/install-git-hooks.go" >&2 exit 1 } |
