From 31f8cb32c6b6cec266f6f97ceefe666addc5069d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 17 Sep 2024 13:32:06 +0100 Subject: fix(remote): `push` exit protocol loop on success so that other protocols are not tried after push was successful --- src/bin/git_remote_nostr/push.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin/git_remote_nostr/push.rs') 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( } else { success = true; if !failed_protocols.is_empty() { - term.write_line(format!("fetch: succeeded over {protocol}").as_str())?; + term.write_line(format!("push: succeeded over {protocol}").as_str())?; let _ = set_protocol_preference(git_repo, protocol, &server_url, &Direction::Push); } + break; } - term.clear_last_lines(1)?; } if success { Ok(()) @@ -391,7 +391,7 @@ fn push_to_remote( "" }, ); - term.write_line(format!("fetch: {error}").as_str())?; + term.write_line(format!("push: {error}").as_str())?; Err(error) } } -- cgit v1.2.3