diff options
author | Aimeast <lixd3389@gmail.com> | 2014-03-31 17:29:01 +0400 |
---|---|---|
committer | Aimeast <lixd3389@gmail.com> | 2014-03-31 17:29:01 +0400 |
commit | bca2f0ec71ca22c95b46852d24baf59e3954bc87 (patch) | |
tree | e1d1b9a558279cee6f269c4efe92c290e291b02f /LibGit2Sharp/IQueryableCommitLog.cs | |
parent | eb08934e9f914975f45eb8ce9c8d29c8dea69dfa (diff) |
Enrich the merge base
1. Bind git_merge_base_many and git_merge_base_octopus
2. Drop git_merge_base
3. Introduce enumeration MergeBaseFindingStrategy
4. Refactor the test case
Diffstat (limited to 'LibGit2Sharp/IQueryableCommitLog.cs')
-rw-r--r-- | LibGit2Sharp/IQueryableCommitLog.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/LibGit2Sharp/IQueryableCommitLog.cs b/LibGit2Sharp/IQueryableCommitLog.cs index 69e5fedd..d73a4307 100644 --- a/LibGit2Sharp/IQueryableCommitLog.cs +++ b/LibGit2Sharp/IQueryableCommitLog.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace LibGit2Sharp { @@ -20,6 +21,7 @@ namespace LibGit2Sharp /// <param name="first">The first <see cref="Commit"/>.</param> /// <param name="second">The second <see cref="Commit"/>.</param> /// <returns>The common ancestor or null if none found.</returns> + [Obsolete("This method will be removed in the next release. Please use FindMergeBase(Commit, Commit).")] Commit FindCommonAncestor(Commit first, Commit second); /// <summary> @@ -27,6 +29,23 @@ namespace LibGit2Sharp /// </summary> /// <param name="commits">The <see cref="Commit"/> for which to find the common ancestor.</param> /// <returns>The common ancestor or null if none found.</returns> + [Obsolete("This method will be removed in the next release. Please use FindMergeBase(IEnumerable<Commit>, MergeBaseFindingStrategy).")] Commit FindCommonAncestor(IEnumerable<Commit> commits); + + /// <summary> + /// Find the best possible merge base given two <see cref="Commit"/>s. + /// </summary> + /// <param name="first">The first <see cref="Commit"/>.</param> + /// <param name="second">The second <see cref="Commit"/>.</param> + /// <returns>The merge base or null if none found.</returns> + Commit FindMergeBase(Commit first, Commit second); + + /// <summary> + /// Find the best possible merge base given two or more <see cref="Commit"/> according to the <see cref="MergeBaseFindingStrategy"/>. + /// </summary> + /// <param name="commits">The <see cref="Commit"/>s for which to find the merge base.</param> + /// <param name="strategy">The strategy to leverage in order to find the merge base.</param> + /// <returns>The merge base or null if none found.</returns> + Commit FindMergeBase(IEnumerable<Commit> commits, MergeBaseFindingStrategy strategy); } } |