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