Skip to content

Commit 30d7752

Browse files
author
Stephan Dilly
committed
commit pending rebase on continue
1 parent 42ca073 commit 30d7752

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

asyncgit/src/sync/rebase.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ pub fn rebase(
108108
pub fn continue_rebase(
109109
repo: &git2::Repository,
110110
) -> Result<RebaseState> {
111+
let mut rebase = repo.open_rebase(None)?;
112+
let signature =
113+
crate::sync::commit::signature_allow_undefined_name(repo)?;
114+
111115
if repo.index()?.has_conflicts() {
112116
return Ok(RebaseState::Conflicted);
113117
}
114118

115-
let mut rebase = repo.open_rebase(None)?;
116-
let signature =
117-
crate::sync::commit::signature_allow_undefined_name(repo)?;
119+
// try commit current rebase step
120+
if !repo.index()?.is_empty() {
121+
rebase.commit(None, &signature, None)?;
122+
}
118123

119124
while let Some(op) = rebase.next() {
120125
let _op = op?;

0 commit comments

Comments
 (0)