diff options
| -rw-r--r-- | src/git_remote_helper.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index e6991d6..6e8f70f 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs | |||
| @@ -99,9 +99,13 @@ async fn main() -> Result<()> { | |||
| 99 | println!(); | 99 | println!(); |
| 100 | } | 100 | } |
| 101 | ["push", refspec] => { | 101 | ["push", refspec] => { |
| 102 | // Why are new branches being pushed without -u? | ||
| 103 | let auth = GitAuthenticator::default(); | 102 | let auth = GitAuthenticator::default(); |
| 104 | auth.push(&git_repo.git_repo, &mut temp_remote, &[refspec])?; | 103 | let git_config = git_repo.git_repo.config()?; |
| 104 | let mut push_options = git2::PushOptions::new(); | ||
| 105 | let mut remote_callbacks = git2::RemoteCallbacks::new(); | ||
| 106 | remote_callbacks.credentials(auth.credentials(&git_config)); | ||
| 107 | push_options.remote_callbacks(remote_callbacks); | ||
| 108 | temp_remote.push(&[refspec], Some(&mut push_options))?; | ||
| 105 | update_remote_refs_from_push_refspecs(&git_repo.git_repo, refspec, url)?; | 109 | update_remote_refs_from_push_refspecs(&git_repo.git_repo, refspec, url)?; |
| 106 | temp_remote.disconnect()?; | 110 | temp_remote.disconnect()?; |
| 107 | println!(); | 111 | println!(); |