Skip to content

Commit 9e324d7

Browse files
author
Jeremy Koritzinsky
committed
Changed methods to use MergeTreeResult and fixed incorrect name in argument validation.
1 parent b722947 commit 9e324d7

File tree

4 files changed

+12
-108
lines changed

4 files changed

+12
-108
lines changed

LibGit2Sharp/CherryPickTreeResult.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
<Compile Include="CheckoutOptions.cs" />
7171
<Compile Include="CherryPickOptions.cs" />
7272
<Compile Include="CherryPickResult.cs" />
73-
<Compile Include="CherryPickTreeResult.cs" />
7473
<Compile Include="CloneOptions.cs" />
7574
<Compile Include="CommitFilter.cs" />
7675
<Compile Include="CommitOptions.cs" />
@@ -161,7 +160,6 @@
161160
<Compile Include="RenameDetails.cs" />
162161
<Compile Include="RevertResult.cs" />
163162
<Compile Include="RevertOptions.cs" />
164-
<Compile Include="RevertTreeResult.cs" />
165163
<Compile Include="SecureUsernamePasswordCredentials.cs" />
166164
<Compile Include="StageOptions.cs" />
167165
<Compile Include="StatusOptions.cs" />
@@ -395,4 +393,4 @@
395393
</Target>
396394
-->
397395
<ItemGroup />
398-
</Project>
396+
</Project>

LibGit2Sharp/ObjectDatabase.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ public virtual HistoryDivergence CalculateHistoryDivergence(Commit one, Commit a
549549
/// <param name="mainline">Which commit to consider the parent for the diff when cherry-picking a merge commit.</param>
550550
/// <param name="options">The options for the merging in the cherry-pick operation.</param>
551551
/// <returns>A result containing a <see cref="Tree"/> if the cherry-pick was successful and a list of <see cref="Conflict"/>s if it is not.</returns>
552-
public virtual CherryPickTreeResult CherryPickCommit(Commit cherryPickCommit, Commit cherryPickOnto, int mainline, MergeOptions options)
552+
public virtual MergeTreeResult CherryPickCommit(Commit cherryPickCommit, Commit cherryPickOnto, int mainline, MergeOptions options)
553553
{
554554
Ensure.ArgumentNotNull(cherryPickCommit, "cherryPickCommit");
555555
Ensure.ArgumentNotNull(cherryPickOnto, "ours");
@@ -584,12 +584,12 @@ public virtual CherryPickTreeResult CherryPickCommit(Commit cherryPickCommit, Co
584584
using (var cherryPickCommitHandle = Proxy.git_object_lookup(repo.Handle, cherryPickCommit.Id, GitObjectType.Commit))
585585
using (var indexHandle = Proxy.git_cherrypick_commit(repo.Handle, cherryPickCommitHandle, cherryPickOntoHandle, (uint)mainline, opts, out earlyStop))
586586
{
587-
CherryPickTreeResult cherryPickResult;
587+
MergeTreeResult cherryPickResult;
588588

589589
// Stopped due to FailOnConflict so there's no index or conflict list
590590
if (earlyStop)
591591
{
592-
return new CherryPickTreeResult(new Conflict[] { });
592+
return new MergeTreeResult(new Conflict[] { });
593593
}
594594

595595
if (Proxy.git_index_has_conflicts(indexHandle))
@@ -603,12 +603,12 @@ public virtual CherryPickTreeResult CherryPickCommit(Commit cherryPickCommit, Co
603603
conflicts.Add(conflict);
604604
}
605605
}
606-
cherryPickResult = new CherryPickTreeResult(conflicts);
606+
cherryPickResult = new MergeTreeResult(conflicts);
607607
}
608608
else
609609
{
610610
var treeId = Proxy.git_index_write_tree_to(indexHandle, repo.Handle);
611-
cherryPickResult = new CherryPickTreeResult(this.repo.Lookup<Tree>(treeId));
611+
cherryPickResult = new MergeTreeResult(this.repo.Lookup<Tree>(treeId));
612612
}
613613

614614
return cherryPickResult;
@@ -889,10 +889,10 @@ private PackBuilderResults InternalPack(PackBuilderOptions options, Action<PackB
889889
/// <param name="mainline">Which commit to consider the parent for the diff when reverting a merge commit.</param>
890890
/// <param name="options">The options for the merging in the revert operation.</param>
891891
/// <returns>A result containing a <see cref="Tree"/> if the revert was successful and a list of <see cref="Conflict"/>s if it is not.</returns>
892-
public virtual RevertTreeResult RevertCommit(Commit revertCommit, Commit revertOnto, int mainline, MergeOptions options)
892+
public virtual MergeTreeResult RevertCommit(Commit revertCommit, Commit revertOnto, int mainline, MergeOptions options)
893893
{
894894
Ensure.ArgumentNotNull(revertCommit, "revertCommit");
895-
Ensure.ArgumentNotNull(revertOnto, "ours");
895+
Ensure.ArgumentNotNull(revertOnto, "revertOnto");
896896

897897
options = options ?? new MergeOptions();
898898

@@ -924,12 +924,12 @@ public virtual RevertTreeResult RevertCommit(Commit revertCommit, Commit revertO
924924
using (var revertCommitHandle = Proxy.git_object_lookup(repo.Handle, revertCommit.Id, GitObjectType.Commit))
925925
using (var indexHandle = Proxy.git_revert_commit(repo.Handle, revertCommitHandle, revertOntoHandle, (uint)mainline, opts, out earlyStop))
926926
{
927-
RevertTreeResult revertTreeResult;
927+
MergeTreeResult revertTreeResult;
928928

929929
// Stopped due to FailOnConflict so there's no index or conflict list
930930
if (earlyStop)
931931
{
932-
return new RevertTreeResult(new Conflict[] { });
932+
return new MergeTreeResult(new Conflict[] { });
933933
}
934934

935935
if (Proxy.git_index_has_conflicts(indexHandle))
@@ -943,12 +943,12 @@ public virtual RevertTreeResult RevertCommit(Commit revertCommit, Commit revertO
943943
conflicts.Add(conflict);
944944
}
945945
}
946-
revertTreeResult = new RevertTreeResult(conflicts);
946+
revertTreeResult = new MergeTreeResult(conflicts);
947947
}
948948
else
949949
{
950950
var treeId = Proxy.git_index_write_tree_to(indexHandle, repo.Handle);
951-
revertTreeResult = new RevertTreeResult(this.repo.Lookup<Tree>(treeId));
951+
revertTreeResult = new MergeTreeResult(this.repo.Lookup<Tree>(treeId));
952952
}
953953

954954
return revertTreeResult;

LibGit2Sharp/RevertTreeResult.cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)