Skip to content

Commit 53f3827

Browse files
codexByron
andcommitted
repo-actions: drop dead git2 commit trait method
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
1 parent e68cd72 commit 53f3827

1 file changed

Lines changed: 1 addition & 41 deletions

File tree

crates/gitbutler-repo-actions/src/repository.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
use std::{str::FromStr, time::UNIX_EPOCH};
22

33
use anyhow::{Context as _, Result, anyhow, bail};
4-
use but_core::commit::Headers;
54
use but_ctx::Context;
65
use but_error::Code;
7-
use but_oxidize::{ObjectIdExt, OidExt};
86
use gitbutler_project::AuthKey;
97
use gitbutler_reference::{Refname, RemoteRefname};
10-
use gitbutler_repo::{
11-
SignaturePurpose, commit_with_signature_gix, credentials, first_parent_commit_ids_until,
12-
signature_gix,
13-
};
8+
use gitbutler_repo::{credentials, first_parent_commit_ids_until};
149
use gitbutler_stack::{Stack, StackId};
1510

1611
use crate::askpass;
@@ -28,13 +23,6 @@ pub trait RepoActionsExt {
2823
askpass_broker: Option<Option<StackId>>,
2924
push_opts: Vec<String>,
3025
) -> Result<String>;
31-
fn commit(
32-
&self,
33-
message: &str,
34-
tree: &git2::Tree,
35-
parents: &[&git2::Commit],
36-
commit_headers: Option<Headers>,
37-
) -> Result<git2::Oid>;
3826
fn distance(&self, from: gix::ObjectId, to: gix::ObjectId) -> Result<u32>;
3927
fn delete_branch_reference(&self, stack: &Stack) -> Result<()>;
4028
fn add_branch_reference(&self, stack: &Stack) -> Result<()>;
@@ -145,34 +133,6 @@ impl RepoActionsExt for Context {
145133
Ok(oids.len().try_into()?)
146134
}
147135

148-
fn commit(
149-
&self,
150-
message: &str,
151-
tree: &git2::Tree,
152-
parents: &[&git2::Commit],
153-
commit_headers: Option<Headers>,
154-
) -> Result<git2::Oid> {
155-
let repo = self.repo.get()?;
156-
let author = signature_gix(SignaturePurpose::Author);
157-
let committer = signature_gix(SignaturePurpose::Committer);
158-
let parent_ids = parents
159-
.iter()
160-
.map(|parent| parent.id().to_gix())
161-
.collect::<Vec<_>>();
162-
commit_with_signature_gix(
163-
&repo,
164-
None,
165-
author,
166-
committer,
167-
message.into(),
168-
tree.id().to_gix(),
169-
&parent_ids,
170-
commit_headers,
171-
)
172-
.map(|id| id.to_git2())
173-
.context("failed to commit")
174-
}
175-
176136
fn push(
177137
&self,
178138
head: gix::ObjectId,

0 commit comments

Comments
 (0)