| … | … | @@ -414,8 +414,14 @@ module.exports = class HyperSync extends ReadyResource { |
| 414 | 414 | |
| 415 | 415 | _gitFetch (repoPath, fetchUrl) { |
| 416 | 416 | return new Promise((resolve, reject) => { |
| 417 | // '+refs/*:refs/*' — leading '+' means force-update. Lets us |
| 418 | // recover when the remote rewrote history (e.g. filter-repo |
| 419 | // strip of node_modules). Without it, git fetch rejects |
| 420 | // non-fast-forward refs and the mirror stays stuck on old |
| 421 | // SHAs forever. Old objects become unreachable on the next |
| 422 | // fetch and get reclaimed by the next gc. |
| 417 | 423 | const proc = spawn('git', [ |
| 418 | | '-C', repoPath, 'fetch', fetchUrl, 'refs/*:refs/*', '--no-tags' |
| 424 | '-C', repoPath, 'fetch', fetchUrl, '+refs/*:refs/*', '--no-tags' |
| 419 | 425 | ], { stdio: ['ignore', 'pipe', 'pipe'] }); |
| 420 | 426 | |
| 421 | 427 | const errChunks = []; |