| … | … | @@ -496,8 +496,12 @@ module.exports = class HyperSync extends ReadyResource { |
| 496 | 496 | // falls back to whatever `git-remote-punch` is already on PATH — no regression |
| 497 | 497 | // for hosts that already have it). |
| 498 | 498 | _ensureRemoteHelper () { |
| 499 | | if (this._remoteHelperDir !== undefined) return this._remoteHelperDir; |
| 500 | | this._remoteHelperDir = null; |
| 499 | // Cache ONLY a successful dir. A null/failed result is NOT cached, so we |
| 500 | // RETRY on the next pull — the first call can fire very early in boot before |
| 501 | // module resolution is ready (returning null); caching that null (the old |
| 502 | // `!== undefined` guard) stuck the daemon helper-less forever → org joiners |
| 503 | // got refs but zero objects even with the resolution fix in place. |
| 504 | if (this._remoteHelperDir) return this._remoteHelperDir; |
| 501 | 505 | try { |
| 502 | 506 | // Resolve git-remote-punch's bin. ORDER MATTERS: prefer the MODULE-RESOLVED |
| 503 | 507 | // (hoisted top-level) copy. In content-addressed pgh bundles, hyper-sync's |
| … | … | @@ -546,10 +550,10 @@ module.exports = class HyperSync extends ReadyResource { |
| 546 | 550 | fs.writeFileSync(shimPath, '#!/bin/sh\nexec "' + barePath + '" "' + helperBin + '" "$@"\n'); |
| 547 | 551 | fs.chmodSync(shimPath, 0o755); |
| 548 | 552 | this._remoteHelperDir = dir; |
| 553 | return dir; |
| 549 | 554 | } catch { |
| 550 | | this._remoteHelperDir = null; |
| 555 | return null; // not cached — retry next call |
| 551 | 556 | } |
| 552 | | return this._remoteHelperDir; |
| 553 | 557 | } |
| 554 | 558 | |
| 555 | 559 | // Env for a `git` child, with the self-provisioned git-remote-punch helper |