From f64e4816df1b1cd948a52e5183f22242c0486c2c Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 26 Jun 2023 02:35:20 -0700 Subject: [PATCH] git: remove unused `push_commit()` --- lib/src/git.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/src/git.rs b/lib/src/git.rs index bd18e8fb9..cf8ce0a44 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -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 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` for the expected current