mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
fix: include npub in clone URLs generated by create_repo_announcement
The clone URL format should be http://{domain}/{npub}/{identifier}.git but was missing the npub segment. This caused git push authorization to fail because the URL didn't match the expected repository path.
This commit is contained in:
@@ -340,10 +340,16 @@ pub fn build_layer3_quote_with_q_tag(
|
||||
/// # Returns
|
||||
/// A signed repository announcement event ready to send.
|
||||
pub fn create_repo_announcement(keys: &Keys, domains: &[&str], identifier: &str) -> Event {
|
||||
// Build clone URLs for all domains (with .git suffix)
|
||||
// Get npub for the clone URL path (format: /<npub>/<identifier>.git)
|
||||
let npub = keys
|
||||
.public_key()
|
||||
.to_bech32()
|
||||
.expect("Failed to convert public key to npub");
|
||||
|
||||
// Build clone URLs for all domains (with npub and .git suffix)
|
||||
let clone_urls: Vec<String> = domains
|
||||
.iter()
|
||||
.map(|d| format!("http://{}/{}.git", d, identifier))
|
||||
.map(|d| format!("http://{}/{}/{}.git", d, npub, identifier))
|
||||
.collect();
|
||||
|
||||
// Build relay URLs for all domains
|
||||
|
||||
Reference in New Issue
Block a user