Skip to content

Commit 153a16b

Browse files
committed
fixups
1 parent 3cb78c2 commit 153a16b

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

LibGit2Sharp.Tests/RebaseFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public void CanAbortRebase()
187187
Assert.Equal(0, rebaseResult.CompletedStepCount);
188188
Assert.Equal(3, rebaseResult.TotalStepCount);
189189

190-
repo.CurrentRebaseOperation.Abort();
190+
repo.CurrentRebaseOperation.Abort(Constants.Signature);
191191
Assert.False(repo.RetrieveStatus().IsDirty);
192192
Assert.True(repo.Index.IsFullyMerged);
193193
Assert.Equal(CurrentOperation.None, repo.Info.CurrentOperation);

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ internal static extern int git_rebase_commit(
264264
[DllImport(libgit2)]
265265
internal static extern int git_rebase_abort(
266266
RebaseSafeHandle rebase,
267-
GitSignature signature);
267+
SignatureSafeHandle signature);
268268

269269
[DllImport(libgit2)]
270270
internal static extern int git_rebase_finish(
271271
RebaseSafeHandle repo,
272-
GitSignature signature,
272+
SignatureSafeHandle signature,
273273
ref GitRebaseOptions options);
274274

275275
[DllImport(libgit2)]

LibGit2Sharp/Core/Proxy.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,22 +1704,28 @@ public static GitOid git_rebase_commit(
17041704

17051705
public static void git_rebase_abort(
17061706
RebaseSafeHandle rebase,
1707-
GitSignature signature)
1707+
Signature signature)
17081708
{
1709+
Ensure.ArgumentNotNull(signature, "signature");
1710+
17091711
using (ThreadAffinity())
1712+
using (var signatureHandle = signature.BuildHandle())
17101713
{
1711-
int result = NativeMethods.git_rebase_abort(rebase, signature);
1714+
int result = NativeMethods.git_rebase_abort(rebase, signatureHandle);
17121715
}
17131716
}
17141717

17151718
public static void git_rebase_finish(
17161719
RebaseSafeHandle repo,
1717-
GitSignature signature,
1720+
Signature signature,
17181721
GitRebaseOptions options)
17191722
{
1723+
Ensure.ArgumentNotNull(signature, "signature");
1724+
17201725
using (ThreadAffinity())
1726+
using (var signatureHandle = signature.BuildHandle())
17211727
{
1722-
int result = NativeMethods.git_rebase_finish(repo, signature, ref options);
1728+
int result = NativeMethods.git_rebase_finish(repo, signatureHandle, ref options);
17231729
Ensure.ZeroResult(result);
17241730
}
17251731
}

LibGit2Sharp/RebaseOperation.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ internal RebaseOperation(Repository repo)
6767
/// <summary>
6868
/// Continue the current rebase.
6969
/// </summary>
70+
/// <param name="committer">The <see cref="Signature"/> of who added the change to the repository.</param>
71+
/// <param name="options">The <see cref="RebaseOptions"/> that specify the commit behavior.</param>
7072
public virtual RebaseResult Continue(Signature committer, RebaseOptions options)
7173
{
7274
Ensure.ArgumentNotNull(committer, "committer");
@@ -109,13 +111,16 @@ public virtual RebaseResult Continue(Signature committer, RebaseOptions options)
109111
/// <summary>
110112
/// Abort the rebase operation.
111113
/// </summary>
112-
public virtual void Abort()
114+
/// <param name="signature">The <see cref="Signature"/> of who is reborting the rebase.</param>
115+
public virtual void Abort(Signature signature)
113116
{
117+
Ensure.ArgumentNotNull(signature, "signature");
118+
114119
RebaseSafeHandle rebase = null;
115120
try
116121
{
117122
rebase = Proxy.git_rebase_open(repository.Handle);
118-
Proxy.git_rebase_abort(rebase, null);
123+
Proxy.git_rebase_abort(rebase, signature);
119124
}
120125
finally
121126
{

LibGit2Sharp/RebaseOperationImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static RebaseResult Run(RebaseSafeHandle rebaseOperationHandle,
5353
// Rebase is completed!
5454
// currentStep is the last completed - increment it to account
5555
// for the fact that we have moved past last step index.
56-
Proxy.git_rebase_finish(rebaseOperationHandle, null, gitRebaseOptions);
56+
Proxy.git_rebase_finish(rebaseOperationHandle, committer, gitRebaseOptions);
5757
rebaseResult = new RebaseResult(RebaseStatus.Complete,
5858
currentStepIndex + 1,
5959
totalStepCount,

0 commit comments

Comments
 (0)