fix(i18n): preserve merge conflicts without runtime

This commit is contained in:
Tianyi Cui
2026-08-09 00:37:46 +08:00
parent 9a4b70cf3b
commit 9c13a62702
12 changed files with 358 additions and 60 deletions

View File

@@ -31,9 +31,15 @@ const PAIRING_MERGE_DRIVER_CONFIG = [
['merge.dsh-translation-pairing.name', 'DeepSeek Harness bilingual pairing records'],
[
'merge.dsh-translation-pairing.driver',
'node --import tsx/esm scripts/merge-translation-pairing.ts %O %A %B %P',
'scripts/merge-translation-pairing-driver.sh %O %A %B %P',
],
]
const PAIRING_MERGE_DRIVER_PROBE = [
'--import',
'tsx/esm',
'scripts/merge-translation-pairing.ts',
'--probe',
]
function errorCode(error) {
return typeof error === 'object' && error !== null && 'code' in error
@@ -678,6 +684,10 @@ function installPairingMergeDriver(root, worktreeConfigPath) {
}
}
function probePairingMergeDriver(root) {
capture(process.execPath, PAIRING_MERGE_DRIVER_PROBE, { cwd: root })
}
async function main() {
if (process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true') return
if (typeof lefthookPackage.bin?.lefthook !== 'string') return
@@ -767,6 +777,7 @@ async function main() {
let pathChanged = false
let rollbackPairingMergeDriver = () => {}
try {
probePairingMergeDriver(root)
rollbackPairingMergeDriver = installPairingMergeDriver(root, worktreeConfigPath)
git(['config', '--worktree', 'core.hooksPath', hooksPath], root)
pathChanged = worktreePath !== hooksPath