diff options
| -rw-r--r-- | src/git_remote_helper.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index ded417f..64604a4 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs | |||
| @@ -75,7 +75,6 @@ async fn main() -> Result<()> { | |||
| 75 | .context("no git server listed in nostr repository announcement")?; | 75 | .context("no git server listed in nostr repository announcement")?; |
| 76 | 76 | ||
| 77 | let mut temp_remote = git_repo.git_repo.remote_anonymous(temp_remote_url)?; | 77 | let mut temp_remote = git_repo.git_repo.remote_anonymous(temp_remote_url)?; |
| 78 | |||
| 79 | loop { | 78 | loop { |
| 80 | let tokens = read_line(&stdin, &mut line)?; | 79 | let tokens = read_line(&stdin, &mut line)?; |
| 81 | 80 | ||
| @@ -104,6 +103,14 @@ async fn main() -> Result<()> { | |||
| 104 | let mut push_options = git2::PushOptions::new(); | 103 | let mut push_options = git2::PushOptions::new(); |
| 105 | let mut remote_callbacks = git2::RemoteCallbacks::new(); | 104 | let mut remote_callbacks = git2::RemoteCallbacks::new(); |
| 106 | remote_callbacks.credentials(auth.credentials(&git_config)); | 105 | remote_callbacks.credentials(auth.credentials(&git_config)); |
| 106 | remote_callbacks.push_update_reference(|name, error| { | ||
| 107 | if let Some(error) = error { | ||
| 108 | println!("error {name} {error}"); | ||
| 109 | } else { | ||
| 110 | println!("ok {name}",); | ||
| 111 | } | ||
| 112 | Ok(()) | ||
| 113 | }); | ||
| 107 | push_options.remote_callbacks(remote_callbacks); | 114 | push_options.remote_callbacks(remote_callbacks); |
| 108 | temp_remote.push( | 115 | temp_remote.push( |
| 109 | &get_refspecs_from_push_batch(&stdin, refspec)?, | 116 | &get_refspecs_from_push_batch(&stdin, refspec)?, |