diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-20 08:07:22 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-20 08:07:22 +0000 |
| commit | 8cc4a21061433c9a29e36c4f33e4d84bea1defee (patch) | |
| tree | 2bb56276d12612585da5f0bd0e7246a5b6b1c535 /src/bin/ngit | |
| parent | cc87576cdfdd3aa18df6e94fbfa079d9e4f0241a (diff) | |
refactor: use nostr url from repo_ref
simplify to allow the removal of warning:
`#[allow(clippy::too_many_arguments)]`
Diffstat (limited to 'src/bin/ngit')
| -rw-r--r-- | src/bin/ngit/sub_commands/init.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index f26eea3..4aa7ced 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs | |||
| @@ -596,9 +596,10 @@ fn ask_to_set_origin_remote(repo_ref: &RepoRef, git_repo: &Repo) -> Result<()> { | |||
| 596 | .with_default(true) | 596 | .with_default(true) |
| 597 | .with_prompt("set remote \"origin\" to the nostr url of your repository?"), | 597 | .with_prompt("set remote \"origin\" to the nostr url of your repository?"), |
| 598 | )? { | 598 | )? { |
| 599 | git_repo | 599 | git_repo.git_repo.remote_set_url( |
| 600 | .git_repo | 600 | "origin", |
| 601 | .remote_set_url("origin", &repo_ref.to_nostr_git_url(&Some(git_repo)))?; | 601 | &repo_ref.to_nostr_git_url(&Some(git_repo)).to_string(), |
| 602 | )?; | ||
| 602 | } | 603 | } |
| 603 | Ok(()) | 604 | Ok(()) |
| 604 | } | 605 | } |
| @@ -609,9 +610,10 @@ fn ask_to_create_new_origin_remote(repo_ref: &RepoRef, git_repo: &Repo) -> Resul | |||
| 609 | .with_default(true) | 610 | .with_default(true) |
| 610 | .with_prompt("set remote \"origin\" to the nostr url of your repository?"), | 611 | .with_prompt("set remote \"origin\" to the nostr url of your repository?"), |
| 611 | )? { | 612 | )? { |
| 612 | git_repo | 613 | git_repo.git_repo.remote( |
| 613 | .git_repo | 614 | "origin", |
| 614 | .remote("origin", &repo_ref.to_nostr_git_url(&Some(git_repo)))?; | 615 | &repo_ref.to_nostr_git_url(&Some(git_repo)).to_string(), |
| 616 | )?; | ||
| 615 | } | 617 | } |
| 616 | Ok(()) | 618 | Ok(()) |
| 617 | } | 619 | } |