diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 15:36:21 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 15:36:21 +0000 |
| commit | bdcfc7ae0b0558843b160acc4d2c8db9996cdc60 (patch) | |
| tree | 5911d5993a2de5f38ada94238936eec619b86926 /src | |
| parent | 09c299ebb1e04bc9d17817371f3e3061fb450443 (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/ngit/sub_commands/comment.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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> { | |||
| 38 | /// When `None` the comment is top-level (parent == root). | 38 | /// When `None` the comment is top-level (parent == root). |
| 39 | /// When `Some` the comment replies to that specific comment event. | 39 | /// When `Some` the comment replies to that specific comment event. |
| 40 | reply_to: Option<EventId>, | 40 | reply_to: Option<EventId>, |
| 41 | git_repo: &'a Repo, | ||
| 41 | git_repo_path: &'a std::path::Path, | 42 | git_repo_path: &'a std::path::Path, |
| 42 | body: &'a str, | 43 | body: &'a str, |
| 43 | entity_name: &'a str, | 44 | entity_name: &'a str, |
| @@ -60,6 +61,7 @@ async fn publish_comment(args: CommentArgs<'_>) -> Result<()> { | |||
| 60 | root_pubkey, | 61 | root_pubkey, |
| 61 | root_kind, | 62 | root_kind, |
| 62 | reply_to, | 63 | reply_to, |
| 64 | git_repo, | ||
| 63 | git_repo_path, | 65 | git_repo_path, |
| 64 | body, | 66 | body, |
| 65 | entity_name, | 67 | entity_name, |
| @@ -92,7 +94,7 @@ async fn publish_comment(args: CommentArgs<'_>) -> Result<()> { | |||
| 92 | 94 | ||
| 93 | // Login | 95 | // Login |
| 94 | let (signer, user_ref, _) = | 96 | let (signer, user_ref, _) = |
| 95 | login::login_or_signup(&None, &None, &None, Some(&client), true).await?; | 97 | login::login_or_signup(&Some(git_repo), &None, &None, Some(&client), true).await?; |
| 96 | 98 | ||
| 97 | let relay_hint = repo_ref | 99 | let relay_hint = repo_ref |
| 98 | .relays | 100 | .relays |
| @@ -203,6 +205,7 @@ pub async fn launch_pr_comment( | |||
| 203 | root_pubkey, | 205 | root_pubkey, |
| 204 | root_kind, | 206 | root_kind, |
| 205 | reply_to: reply_to_id, | 207 | reply_to: reply_to_id, |
| 208 | git_repo: &git_repo, | ||
| 206 | git_repo_path, | 209 | git_repo_path, |
| 207 | body, | 210 | body, |
| 208 | entity_name: "PR", | 211 | entity_name: "PR", |
| @@ -247,6 +250,7 @@ pub async fn launch_issue_comment( | |||
| 247 | root_pubkey, | 250 | root_pubkey, |
| 248 | root_kind: Kind::GitIssue, | 251 | root_kind: Kind::GitIssue, |
| 249 | reply_to: reply_to_id, | 252 | reply_to: reply_to_id, |
| 253 | git_repo: &git_repo, | ||
| 250 | git_repo_path, | 254 | git_repo_path, |
| 251 | body, | 255 | body, |
| 252 | entity_name: "issue", | 256 | entity_name: "issue", |