Implement getNostrRemoteInfo simple version

This commit is contained in:
Alex Gleason committed 2025-12-25 18:04:33 -06:00
1 parent e2c4da5300
commit 6d001daf8a
1 file changed
+20 -2
+20 -2
View File
@@ -640,9 +640,27 @@ export class Git {
refs: Record<string, string>;
HEAD?: string;
}> {
// TODO: implement Nostr remote info retrieval
}
const capabilities = ['symrefs', 'fetch', 'push'];
const refs: Record<string, string> = {};
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<Parameters<typeof git.clone>[0], 'fs' | 'http' | 'corsProxy'>): Promise<void> {
// TODO: implement Nostr clone