| … | … | @@ -445,9 +445,26 @@ export class GitSyncClientManager { |
| 445 | 445 | child.on('error', reject) |
| 446 | 446 | }) |
| 447 | 447 | |
| 448 | | // Auto-install post-receive hook for federation sync |
| 448 | // Auto-install post-receive hook and register with server |
| 449 | 449 | if (this._repoRegistry) { |
| 450 | 450 | await this._repoRegistry.ensurePostReceiveHook(repoPath) |
| 451 | |
| 452 | // Register so the repo appears in the web UI and API immediately |
| 453 | const repoName = path.basename(repoPath, '.git') |
| 454 | await this._repoRegistry.register({ |
| 455 | name: repoName, |
| 456 | path: repoPath, |
| 457 | visibility: 'public' |
| 458 | }) |
| 459 | console.log(`[GitSyncClient] Registered ${repoName} with server`) |
| 460 | |
| 461 | // Update in-memory repos list so it's immediately queryable |
| 462 | if (this._repos) { |
| 463 | const exists = this._repos.find(r => r.name === repoName) |
| 464 | if (!exists) { |
| 465 | this._repos.push({ name: repoName, path: repoPath, visibility: 'public' }) |
| 466 | } |
| 467 | } |
| 451 | 468 | } |
| 452 | 469 | } |
| 453 | 470 | |