dsh-home-sync 0.2.2 → 0.2.3
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/lib/sync.js +5 -1
- package/package.json +2 -2
package/lib/sync.js
CHANGED
|
@@ -108,8 +108,12 @@ export function createHomeSync(directory = process.env.DSH_HOME || path.join(os.
|
|
|
108
108
|
for (const key of Object.keys(env)) if (/^GIT_(DIR|WORK_TREE|COMMON_DIR|INDEX_FILE|OBJECT_DIRECTORY|ALTERNATE_OBJECT_DIRECTORIES|NAMESPACE|CONFIG_COUNT|CONFIG_KEY_.*|CONFIG_VALUE_.*|CONFIG_PARAMETERS|CEILING_DIRECTORIES|DISCOVERY_ACROSS_FILESYSTEM|PREFIX|SSH|SSH_COMMAND)$/.test(key)) delete env[key]
|
|
109
109
|
env.GIT_TERMINAL_PROMPT = '0'; env.GCM_INTERACTIVE = 'never'; env.GIT_OPTIONAL_LOCKS = '0'; env.GIT_NO_REPLACE_OBJECTS = '1'
|
|
110
110
|
if (cfg.sshBatch) env.GIT_SSH_COMMAND = 'ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15'
|
|
111
|
+
// `safe.directory=*` skips Git's "dubious ownership" check: we only run
|
|
112
|
+
// Git inside the validated DSH home or our own temp repositories, so a
|
|
113
|
+
// directory legitimately owned by another Windows user (e.g. created by
|
|
114
|
+
// an elevated prompt) must not block sync/init.
|
|
111
115
|
return new Promise(resolve => {
|
|
112
|
-
const child = execFile('git', ['--literal-pathspecs', '-C', cwd, ...args],
|
|
116
|
+
const child = execFile('git', ['-c', 'safe.directory=*', '--literal-pathspecs', '-C', cwd, ...args],
|
|
113
117
|
{ env, timeout: 90000, windowsHide: true, maxBuffer: 16 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
114
118
|
resolve({ ok: !error, code: error?.code ?? 0, stdout: String(stdout || ''), stderr: String(stderr || ''), timedOut: !!error?.killed })
|
|
115
119
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "dsh-home-sync",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Git-based sync for DSH configuration and Mnemon memory plugin data, with automatic two-way sync, cross-device migration, initialization backups, conflict detection, and a web UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|