diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/git_remote_nostr/push.rs | 5 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/init.rs | 4 | ||||
| -rw-r--r-- | src/lib/git/mod.rs | 5 | ||||
| -rw-r--r-- | src/lib/git/nostr_url.rs | 4 |
4 files changed, 7 insertions, 11 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index fc82796..1645ae8 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs | |||
| @@ -1391,10 +1391,7 @@ fn update_remote_refs_pushed( | |||
| 1391 | 1391 | ||
| 1392 | fn refspec_to_from_to(refspec: &str) -> Result<(&str, &str)> { | 1392 | fn refspec_to_from_to(refspec: &str) -> Result<(&str, &str)> { |
| 1393 | if !refspec.contains(':') { | 1393 | if !refspec.contains(':') { |
| 1394 | bail!( | 1394 | bail!("refspec should contain a colon (:) but consists of: {refspec}"); |
| 1395 | "refspec should contain a colon (:) but consists of: {}", | ||
| 1396 | refspec | ||
| 1397 | ); | ||
| 1398 | } | 1395 | } |
| 1399 | let parts = refspec.split(':').collect::<Vec<&str>>(); | 1396 | let parts = refspec.split(':').collect::<Vec<&str>>(); |
| 1400 | Ok(( | 1397 | Ok(( |
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index e28268d..39fe670 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs | |||
| @@ -1055,7 +1055,7 @@ fn push_main_or_master_branch(git_repo: &Repo) -> Result<()> { | |||
| 1055 | if exit_status.success() { | 1055 | if exit_status.success() { |
| 1056 | Ok(()) | 1056 | Ok(()) |
| 1057 | } else { | 1057 | } else { |
| 1058 | bail!("git push process exited with an error: {}", exit_status); | 1058 | bail!("git push process exited with an error: {exit_status}"); |
| 1059 | } | 1059 | } |
| 1060 | } | 1060 | } |
| 1061 | 1061 | ||
| @@ -1086,6 +1086,6 @@ fn run_ngit_sync() -> Result<()> { | |||
| 1086 | if exit_status.success() { | 1086 | if exit_status.success() { |
| 1087 | Ok(()) | 1087 | Ok(()) |
| 1088 | } else { | 1088 | } else { |
| 1089 | bail!("ngit sync process exited with an error: {}", exit_status); | 1089 | bail!("ngit sync process exited with an error: {exit_status}"); |
| 1090 | } | 1090 | } |
| 1091 | } | 1091 | } |
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index 06573eb..b9711ae 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs | |||
| @@ -459,8 +459,7 @@ impl RepoActions for Repo { | |||
| 459 | }) { | 459 | }) { |
| 460 | None => { | 460 | None => { |
| 461 | bail!(format!( | 461 | bail!(format!( |
| 462 | "{} is not an ancestor of {}", | 462 | "{latest_commit} is not an ancestor of {base_commit}" |
| 463 | latest_commit, base_commit | ||
| 464 | )); | 463 | )); |
| 465 | } | 464 | } |
| 466 | Some(res) => res.context("revwalk failed to reveal commit")?, | 465 | Some(res) => res.context("revwalk failed to reveal commit")?, |
| @@ -671,7 +670,7 @@ impl RepoActions for Repo { | |||
| 671 | if !applied_oid.to_string().eq(commit_id) { | 670 | if !applied_oid.to_string().eq(commit_id) { |
| 672 | bail!( | 671 | bail!( |
| 673 | "when applied the patch commit id ({}) doesn't match the one specified in the event tag ({})", | 672 | "when applied the patch commit id ({}) doesn't match the one specified in the event tag ({})", |
| 674 | applied_oid.to_string(), | 673 | applied_oid, |
| 675 | get_commit_id_from_patch(patch)?, | 674 | get_commit_id_from_patch(patch)?, |
| 676 | ); | 675 | ); |
| 677 | } | 676 | } |
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index 0a8338a..23c98e7 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs | |||
| @@ -543,7 +543,7 @@ pub fn convert_clone_url_to_https(url: &str) -> Result<String> { | |||
| 543 | // Construct the HTTPS URL | 543 | // Construct the HTTPS URL |
| 544 | return Ok(format!("https://{}/{}", parts[0], parts[1..].join("/"))); | 544 | return Ok(format!("https://{}/{}", parts[0], parts[1..].join("/"))); |
| 545 | } | 545 | } |
| 546 | bail!("Invalid SSH URL format: {}", url); | 546 | bail!("Invalid SSH URL format: {url}"); |
| 547 | } | 547 | } |
| 548 | // Convert ftp:// to https:// | 548 | // Convert ftp:// to https:// |
| 549 | else if stripped_url.starts_with("ftp://") { | 549 | else if stripped_url.starts_with("ftp://") { |
| @@ -555,7 +555,7 @@ pub fn convert_clone_url_to_https(url: &str) -> Result<String> { | |||
| 555 | } | 555 | } |
| 556 | 556 | ||
| 557 | // If the URL is neither HTTPS, SSH, nor git@, return an error | 557 | // If the URL is neither HTTPS, SSH, nor git@, return an error |
| 558 | bail!("Unsupported URL protocol: {}", url); | 558 | bail!("Unsupported URL protocol: {url}"); |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | // Function to strip username and password from the URL | 561 | // Function to strip username and password from the URL |