Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): scheduled tasks use the project default branch #22801

Closedjuliusmarmingewants to merge 8 commits intomain fromfix/issue-16183opened View on GitHub

Showing 11 changed files with 73 additions and 0 deletions (loading 8).

x
0 of 11 viewed, 11 left
59 additions and 0 deletionsapps/server/scripts/seed-scheduled-task-worktree-fixture.shAdded
View file
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+set -euo pipefail
+​
+# Usage: bash apps/server/scripts/seed-scheduled-task-worktree-fixture.sh [new-directory]
+# Only creates a local Git fixture; register its project in an isolated T3 home.
+fixture_root="${1:-$(mktemp -d /tmp/t3-scheduled-worktree.XXXXXX)}"
+mkdir -p "$fixture_root"
+fixture_root="$(cd "$fixture_root" && pwd -P)"
+if [[ -e "$fixture_root/origin.git" || -e "$fixture_root/project" ]]; then
+ printf 'Refusing to overwrite an existing fixture: %s\n' "$fixture_root" >&2
+ exit 1
+fi
+​
+git init --quiet --bare --object-format=sha1 --initial-branch=master "$fixture_root/origin.git"
+​
+# The fixture data is an empty tree with a fixed identity, timestamp and message.
+# Reproduce the runtime evidence commit without depending on the caller's config.
+fixture_tree="$(git --git-dir="$fixture_root/origin.git" hash-object -w -t tree --stdin </dev/null)"
+fixture_commit="$(
+ GIT_AUTHOR_NAME=Triage GIT_AUTHOR_EMAIL=triage@example.invalid \
+ GIT_COMMITTER_NAME=Triage GIT_COMMITTER_EMAIL=triage@example.invalid \
+ GIT_AUTHOR_DATE='2026-10-21T09:52:47+00:00' \
+ GIT_COMMITTER_DATE='2026-10-21T09:52:47+00:00' \
+ git --git-dir="$fixture_root/origin.git" -c commit.gpgsign=false commit-tree "$fixture_tree" -m fixture
+)"
+[[ "$fixture_commit" == 5cade2a196ef3c8da4151a9e8ced1c1b5a04c336 ]]
+git --git-dir="$fixture_root/origin.git" update-ref refs/heads/master "$fixture_commit"
+git clone --quiet --no-local "$fixture_root/origin.git" "$fixture_root/project"
+git -C "$fixture_root/project" symbolic-ref --delete refs/remotes/origin/HEAD
+​