diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-17 13:32:06 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-17 13:32:06 +0100 |
| commit | 31f8cb32c6b6cec266f6f97ceefe666addc5069d (patch) | |
| tree | 338c532e0a71392b974ce55767181756aa4f81c5 /src/bin/git_remote_nostr/push.rs | |
| parent | a4bcaf98cc7a00a71f34ed382dc65414eaec5bff (diff) | |
fix(remote): `push` exit protocol loop on success
so that other protocols are not tried after push was successful
Diffstat (limited to 'src/bin/git_remote_nostr/push.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/push.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index de18828..9dbec0d 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs | |||
| @@ -372,11 +372,11 @@ fn push_to_remote( | |||
| 372 | } else { | 372 | } else { |
| 373 | success = true; | 373 | success = true; |
| 374 | if !failed_protocols.is_empty() { | 374 | if !failed_protocols.is_empty() { |
| 375 | term.write_line(format!("fetch: succeeded over {protocol}").as_str())?; | 375 | term.write_line(format!("push: succeeded over {protocol}").as_str())?; |
| 376 | let _ = set_protocol_preference(git_repo, protocol, &server_url, &Direction::Push); | 376 | let _ = set_protocol_preference(git_repo, protocol, &server_url, &Direction::Push); |
| 377 | } | 377 | } |
| 378 | break; | ||
| 378 | } | 379 | } |
| 379 | term.clear_last_lines(1)?; | ||
| 380 | } | 380 | } |
| 381 | if success { | 381 | if success { |
| 382 | Ok(()) | 382 | Ok(()) |
| @@ -391,7 +391,7 @@ fn push_to_remote( | |||
| 391 | "" | 391 | "" |
| 392 | }, | 392 | }, |
| 393 | ); | 393 | ); |
| 394 | term.write_line(format!("fetch: {error}").as_str())?; | 394 | term.write_line(format!("push: {error}").as_str())?; |
| 395 | Err(error) | 395 | Err(error) |
| 396 | } | 396 | } |
| 397 | } | 397 | } |