@akagilnc/pi-workflow-roles 0.1.1766 → 0.1.1770

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.1766",
3
+ "version": "0.1.1770",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -90,7 +90,25 @@ export function installWorkerGitHooks(cwd: string): void {
90
90
  try { bareInCommon = gitFile(commonConfig, ["--get", "core.bare"]) === "true"; } catch { /* unset */ }
91
91
  try { worktreeInCommon = gitFile(commonConfig, ["--get", "core.worktree"]); } catch { /* unset */ }
92
92
 
93
- git(cwd, ["config", "extensions.worktreeConfig", "true"]);
93
+ // Skip shared write when already enabled in *this* repo — concurrent sibling activations
94
+ // otherwise race on .git/config.lock (#267). Scope must be --local (common config): a
95
+ // global/system true must not skip the repo's first enable. Value must use Git bool
96
+ // semantics (true/yes/on/1), not a literal "true" compare. First enable still writes;
97
+ // real write failures still throw. Only --get exit 1 means unset; other failures stay loud.
98
+ let worktreeConfigEnabled = false;
99
+ try {
100
+ worktreeConfigEnabled =
101
+ git(cwd, ["config", "--local", "--bool", "--get", "extensions.worktreeConfig"]) === "true";
102
+ } catch (error) {
103
+ const status =
104
+ typeof error === "object" && error !== null && "status" in error
105
+ ? (error as { status: unknown }).status
106
+ : undefined;
107
+ if (status !== 1) throw error;
108
+ }
109
+ if (!worktreeConfigEnabled) {
110
+ git(cwd, ["config", "extensions.worktreeConfig", "true"]);
111
+ }
94
112
 
95
113
  // Migrate immediately so sibling trees never observe bare-in-common under worktreeConfig.
96
114
  if (bareInCommon) {