upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/git_remote_nostr/push.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index e5c33b6..b0e7726 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -1573,11 +1573,17 @@ fn refspec_remote_ref_name(
1573 let nostr_remote = git_repo 1573 let nostr_remote = git_repo
1574 .find_remote(&get_remote_name_by_url(git_repo, nostr_remote_url)?) 1574 .find_remote(&get_remote_name_by_url(git_repo, nostr_remote_url)?)
1575 .context("we should have just located this remote")?; 1575 .context("we should have just located this remote")?;
1576 let short_name = if let Some(s) = to.strip_prefix("refs/heads/") {
1577 s.to_string()
1578 } else if let Some(s) = to.strip_prefix("refs/tags/") {
1579 s.to_string()
1580 } else {
1581 to.to_string()
1582 };
1576 Ok(format!( 1583 Ok(format!(
1577 "refs/remotes/{}/{}", 1584 "refs/remotes/{}/{}",
1578 nostr_remote.name().context("remote should have a name")?, 1585 nostr_remote.name().context("remote should have a name")?,
1579 to.replace("refs/heads/", ""), /* TODO only replace if it begins with this 1586 short_name,
1580 * TODO what about tags? */
1581 )) 1587 ))
1582} 1588}
1583 1589