fix: resolve publish lock in git worktree

This commit is contained in:
冰朔 2026-09-09 13:49:35 +08:00
commit 4ff84ac677
2 changed files with 3 additions and 2 deletions

View file

@ -70,7 +70,8 @@ export function validateCurrentTcsBinding(stateDirectory, expectedSession = proc
}
function acquireCurrentPublishLock(worktree, developmentId, binding) {
const lockPath = path.join(worktree, ".git", "guanghu-current-tcs-publish.lock");
const gitDirectory = path.resolve(worktree, git(worktree, ["rev-parse", "--git-dir"]));
const lockPath = path.join(gitDirectory, "guanghu-current-tcs-publish.lock");
const descriptor = fs.openSync(lockPath, "wx", 0o600);
fs.writeFileSync(descriptor, `${JSON.stringify({ development_id: developmentId, binding, created_at: new Date().toISOString() })}\n`);
return { descriptor, lockPath };