From 6d001daf8a295b4eedd5c64c46009b3594d2c4db Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 25 Dec 2025 18:04:33 -0600 Subject: [PATCH] Implement getNostrRemoteInfo simple version --- src/lib/git.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/lib/git.ts b/src/lib/git.ts index 4f451f41..2767a8c2 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -640,9 +640,27 @@ export class Git { refs: Record; HEAD?: string; }> { - // TODO: implement Nostr remote info retrieval - } + const capabilities = ['symrefs', 'fetch', 'push']; + const refs: Record = {}; + const { state } = await this.fetchRepoEvents(nostrURI); + + if (!state) { + return { capabilities, refs }; + } + + for (const [name, value] of state.tags) { + if (name === 'HEAD' || name.startsWith('refs/')) { + refs[name] = value; + } + } + + return { + capabilities, + refs, + HEAD: refs['HEAD'], + }; + } private async nostrClone(nostrURI: NostrURI, options: Omit[0], 'fs' | 'http' | 'corsProxy'>): Promise { // TODO: implement Nostr clone