fix(cli): stage a rewritten shared lockfile on git-sync deploy push (#11126)

* fix(cli): stage a rewritten shared lockfile on git-sync deploy push

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGciSSE5EFMiDf1dFWQq5M

* test(cli): pin that a swept shared lockfile is committed as a deletion

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGciSSE5EFMiDf1dFWQq5M

* chore: bump the git sync hub script to 28969

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGciSSE5EFMiDf1dFWQq5M

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-09-14 23:16:37 +02:00
committed by GitHub
co-authored by Claude Fable 5.1
parent 5dcf40cb4f
commit 75ee497011
3 changed files with 105 additions and 1 deletions
+6
View File
@@ -1,6 +1,7 @@
import * as log from "../core/log.ts";
import { execSync, spawnSync } from "node:child_process";
import { WM_FORK_PREFIX } from "../core/constants.ts";
import { SHARED_LOCK_DIR } from "./script_common.ts";
// Fork *workspace id* prefix ("wm-fork-"). WM_FORK_PREFIX is the *branch*
// prefix ("wm-fork") used inside the wm-fork/<branch>/<id> branch name.
@@ -584,6 +585,11 @@ export function gitSyncDeployPush(params: {
git(["add", "wmill-lock.yaml", `${parent_path}**`], { allowFail: true });
}
}
// A shared lockfile (`dedupeLockfiles`) lives under `locks/`, outside every
// item's path glob, and the pull rewrites it when a deployed script's lock
// changed. `-A` also stages the deletion of a swept one; the add fails only
// when nothing under `locks/` exists or is tracked.
git(["add", "-A", "--", SHARED_LOCK_DIR], { allowFail: true });
// `git diff --cached --quiet` exits 1 iff there is something staged.
const staged = git(["diff", "--cached", "--quiet"], { allowFail: true });