Skip to content

Commit 8967743

Browse files
committed
In case of reabese of repository with submodules, submodules are left in non updatred state and prevent rebase from continuing.
Fixed that by updating submodules after rebase was initialized.
1 parent 7fc4be5 commit 8967743

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

LibGit2Sharp/Rebase.cs

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public virtual RebaseResult Start(Branch branch, Branch upstream, Branch onto, I
119119
ontoRefAnnotatedCommitHandle,
120120
gitRebaseOptions))
121121
{
122+
this.repository.Submodules.UpdateAll(new SubmoduleUpdateOptions());
123+
122124
RebaseResult rebaseResult = RebaseOperationImpl.Run(rebaseOperationHandle,
123125
this.repository,
124126
committer,

LibGit2Sharp/SubmoduleCollection.cs

+7
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ public virtual void Init(string name, bool overwrite)
7070
}
7171
}
7272

73+
74+
public virtual void UpdateAll(SubmoduleUpdateOptions options)
75+
{
76+
foreach (var sm in this)
77+
Update(sm.Name, options);
78+
}
79+
7380
/// <summary>
7481
/// Update specified submodule.
7582
/// <para>

0 commit comments

Comments
 (0)