Skip to content

Commit 9f8fc6b

Browse files
author
Stephan Dilly
committed
cleanup
1 parent 23516f1 commit 9f8fc6b

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

asyncgit/src/sync/rebase.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@ use crate::{
88

99
use super::CommitId;
1010

11-
fn rebase_branch_repo(
12-
repo: &Repository,
13-
branch_name: &str,
14-
) -> Result<CommitId> {
15-
let branch = repo.find_branch(branch_name, BranchType::Local)?;
16-
17-
let annotated =
18-
repo.reference_to_annotated_commit(&branch.into_reference())?;
19-
20-
conflict_free_rebase(repo, &annotated)
21-
}
22-
2311
/// rebase current HEAD on `branch`
2412
pub fn rebase_branch(
2513
repo_path: &str,
@@ -32,6 +20,18 @@ pub fn rebase_branch(
3220
rebase_branch_repo(&repo, branch)
3321
}
3422

23+
fn rebase_branch_repo(
24+
repo: &Repository,
25+
branch_name: &str,
26+
) -> Result<CommitId> {
27+
let branch = repo.find_branch(branch_name, BranchType::Local)?;
28+
29+
let annotated =
30+
repo.reference_to_annotated_commit(&branch.into_reference())?;
31+
32+
conflict_free_rebase(repo, &annotated)
33+
}
34+
3535
/// rebase attempt which aborts and undo's rebase if any conflict appears
3636
pub fn conflict_free_rebase(
3737
repo: &git2::Repository,
@@ -43,7 +43,6 @@ pub fn conflict_free_rebase(
4343
let mut last_commit = None;
4444
while let Some(op) = rebase.next() {
4545
let _op = op?;
46-
// dbg!(op.id());
4746

4847
if repo.index()?.has_conflicts() {
4948
rebase.abort()?;

0 commit comments

Comments
 (0)