javascript-solid-server 0.0.44 → 0.0.45
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/.claude/settings.local.json +2 -1
- package/package.json +1 -1
- package/src/handlers/git.js +8 -15
|
@@ -138,7 +138,8 @@
|
|
|
138
138
|
"Bash(gh gist edit:*)",
|
|
139
139
|
"Bash(gh gist view:*)",
|
|
140
140
|
"Bash(./bin/git-credential-nostr acl:*)",
|
|
141
|
-
"Bash(DATA_ROOT=/tmp/jss-git-test/data node:*)"
|
|
141
|
+
"Bash(DATA_ROOT=/tmp/jss-git-test/data node:*)",
|
|
142
|
+
"Bash(git remote set-url:*)"
|
|
142
143
|
]
|
|
143
144
|
}
|
|
144
145
|
}
|
package/package.json
CHANGED
package/src/handlers/git.js
CHANGED
|
@@ -93,6 +93,14 @@ export async function handleGit(request, reply) {
|
|
|
93
93
|
return reply.code(404).send({ error: 'Not a git repository' });
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// Auto-configure non-bare repos to accept pushes and update working directory
|
|
97
|
+
if (gitInfo.isRegular && isGitWriteOperation(urlPath)) {
|
|
98
|
+
spawn('git', ['config', 'receive.denyCurrentBranch', 'updateInstead'], {
|
|
99
|
+
cwd: repoAbs,
|
|
100
|
+
env: { ...process.env, GIT_DIR: gitInfo.gitDir }
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
96
104
|
// Build CGI environment
|
|
97
105
|
const env = {
|
|
98
106
|
...process.env,
|
|
@@ -202,21 +210,6 @@ export async function handleGit(request, reply) {
|
|
|
202
210
|
reply.code(500).send({ error: 'Git operation failed' });
|
|
203
211
|
}
|
|
204
212
|
|
|
205
|
-
// Auto-checkout working directory after successful push to non-bare repo
|
|
206
|
-
if (code === 0 && isGitWriteOperation(urlPath) && gitInfo.isRegular) {
|
|
207
|
-
const checkout = spawn('git', ['checkout', '-f'], {
|
|
208
|
-
cwd: repoAbs,
|
|
209
|
-
env: {
|
|
210
|
-
...process.env,
|
|
211
|
-
GIT_DIR: gitInfo.gitDir,
|
|
212
|
-
GIT_WORK_TREE: repoAbs
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
checkout.on('error', (err) => {
|
|
216
|
-
console.error('Auto-checkout failed:', err.message);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
213
|
resolve();
|
|
221
214
|
});
|
|
222
215
|
});
|