From bdcfc7ae0b0558843b160acc4d2c8db9996cdc60 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 15:36:21 +0000 Subject: fix(comment): pass git_repo to login so local config takes precedence publish_comment was calling login_or_signup with &None for git_repo, causing the GitLocal source to be skipped entirely. This meant the global git config (including any bunker-uri) was used instead of the local nsec, ignoring the local login. Pass the discovered Repo through CommentArgs so local config correctly takes precedence over global. --- src/bin/ngit/sub_commands/comment.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/bin/ngit/sub_commands/comment.rs') diff --git a/src/bin/ngit/sub_commands/comment.rs b/src/bin/ngit/sub_commands/comment.rs index 60626e5..623c88d 100644 --- a/src/bin/ngit/sub_commands/comment.rs +++ b/src/bin/ngit/sub_commands/comment.rs @@ -38,6 +38,7 @@ struct CommentArgs<'a> { /// When `None` the comment is top-level (parent == root). /// When `Some` the comment replies to that specific comment event. reply_to: Option, + git_repo: &'a Repo, git_repo_path: &'a std::path::Path, body: &'a str, entity_name: &'a str, @@ -60,6 +61,7 @@ async fn publish_comment(args: CommentArgs<'_>) -> Result<()> { root_pubkey, root_kind, reply_to, + git_repo, git_repo_path, body, entity_name, @@ -92,7 +94,7 @@ async fn publish_comment(args: CommentArgs<'_>) -> Result<()> { // Login let (signer, user_ref, _) = - login::login_or_signup(&None, &None, &None, Some(&client), true).await?; + login::login_or_signup(&Some(git_repo), &None, &None, Some(&client), true).await?; let relay_hint = repo_ref .relays @@ -203,6 +205,7 @@ pub async fn launch_pr_comment( root_pubkey, root_kind, reply_to: reply_to_id, + git_repo: &git_repo, git_repo_path, body, entity_name: "PR", @@ -247,6 +250,7 @@ pub async fn launch_issue_comment( root_pubkey, root_kind: Kind::GitIssue, reply_to: reply_to_id, + git_repo: &git_repo, git_repo_path, body, entity_name: "issue", -- cgit v1.2.3