git: remove unused push_commit()

This commit is contained in:
Martin von Zweigbergk 2023-06-26 02:35:20 -07:00 committed by Martin von Zweigbergk
parent 75f3537893
commit f64e4816df

View file

@ -21,7 +21,6 @@ use itertools::Itertools;
use thiserror::Error;
use crate::backend::{CommitId, ObjectId};
use crate::commit::Commit;
use crate::git_backend::NO_GC_REF_NAMESPACE;
use crate::op_store::RefTarget;
use crate::repo::{MutableRepo, Repo};
@ -551,29 +550,6 @@ pub enum GitPushError {
InternalGitError(#[from] git2::Error),
}
pub fn push_commit(
git_repo: &git2::Repository,
target: &Commit,
remote_name: &str,
remote_branch: &str,
// TODO: We want this to be an Option<CommitId> for the expected current commit on the remote.
// It's a blunt "force" option instead until git2-rs supports the "push negotiation" callback
// (https://github.com/rust-lang/git2-rs/issues/733).
force: bool,
callbacks: RemoteCallbacks<'_>,
) -> Result<(), GitPushError> {
push_updates(
git_repo,
remote_name,
&[GitRefUpdate {
qualified_name: format!("refs/heads/{remote_branch}"),
force,
new_target: Some(target.id().clone()),
}],
callbacks,
)
}
pub struct GitRefUpdate {
pub qualified_name: String,
// TODO: We want this to be a `current_target: Option<CommitId>` for the expected current