diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/ngit/sub_commands/sync.rs | 4 | ||||
| -rw-r--r-- | src/lib/push.rs | 15 |
2 files changed, 5 insertions, 14 deletions
diff --git a/src/bin/ngit/sub_commands/sync.rs b/src/bin/ngit/sub_commands/sync.rs index e7033b2..00dfe75 100644 --- a/src/bin/ngit/sub_commands/sync.rs +++ b/src/bin/ngit/sub_commands/sync.rs | |||
| @@ -141,8 +141,8 @@ pub async fn launch(args: &SubCommandArgs) -> Result<()> { | |||
| 141 | "error pushing updates to {remote_name}: error: {error}" | 141 | "error pushing updates to {remote_name}: error: {error}" |
| 142 | ))?; | 142 | ))?; |
| 143 | } | 143 | } |
| 144 | Ok(failed_refs) => { | 144 | Ok(updated_refs) => { |
| 145 | if failed_refs.is_empty() { | 145 | if updated_refs.values().all(std::option::Option::is_none) { |
| 146 | if *is_grasp_server || args.force { | 146 | if *is_grasp_server || args.force { |
| 147 | term.write_line(&format!("{remote_name} sync completed"))?; | 147 | term.write_line(&format!("{remote_name} sync completed"))?; |
| 148 | // TODO we only know if there was an error but not | 148 | // TODO we only know if there was an error but not |
diff --git a/src/lib/push.rs b/src/lib/push.rs index 0ee66cf..8cb0212 100644 --- a/src/lib/push.rs +++ b/src/lib/push.rs | |||
| @@ -63,10 +63,9 @@ pub fn push_to_remote( | |||
| 63 | } | 63 | } |
| 64 | Ok(ref_updates_on_protocol) => { | 64 | Ok(ref_updates_on_protocol) => { |
| 65 | success = true; | 65 | success = true; |
| 66 | if remote_refspecs.len() == ref_updates_on_protocol.len() | 66 | if ref_updates_on_protocol |
| 67 | && ref_updates_on_protocol | 67 | .values() |
| 68 | .values() | 68 | .all(|error| error.is_none()) |
| 69 | .all(|error| error.is_none()) | ||
| 70 | { | 69 | { |
| 71 | if !failed_protocols.is_empty() { | 70 | if !failed_protocols.is_empty() { |
| 72 | term.write_line(format!("push: succeeded over {protocol}").as_str())?; | 71 | term.write_line(format!("push: succeeded over {protocol}").as_str())?; |
| @@ -444,14 +443,6 @@ pub async fn push_refs_and_generate_pr_or_pr_update_event( | |||
| 444 | "push: error sending commit data to {normalized_url}: {error}" | 443 | "push: error sending commit data to {normalized_url}: {error}" |
| 445 | ))?; | 444 | ))?; |
| 446 | responses.push((clone_url.clone(), Err(anyhow!(error.clone())))); | 445 | responses.push((clone_url.clone(), Err(anyhow!(error.clone())))); |
| 447 | } else if ref_updates.is_empty() { | ||
| 448 | term.write_line(&format!( | ||
| 449 | "push: error sending commit data to {normalized_url}: server didn't confirm acceptance" | ||
| 450 | ))?; | ||
| 451 | responses.push(( | ||
| 452 | clone_url.clone(), | ||
| 453 | Err(anyhow!("server didn't confirm acceptance")), | ||
| 454 | )); | ||
| 455 | } else { | 446 | } else { |
| 456 | responses.push((clone_url.clone(), Ok(()))); | 447 | responses.push((clone_url.clone(), Ok(()))); |
| 457 | term.write_line(&format!("push: commit data sent to {normalized_url}"))?; | 448 | term.write_line(&format!("push: commit data sent to {normalized_url}"))?; |