Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-11-14 01:24:36 +0400
committernulltoken <emeric.fermas@gmail.com>2013-12-06 03:53:35 +0400
commita845db98d9eff7fe16a371d7c08b9f2715801d94 (patch)
tree40637aae49b8f03265315c2a991d8bdb977e0b7b /LibGit2Sharp/ObjectDatabase.cs
parent442f7a80502ed919d94891400f7766b8415f106d (diff)
Introduce ObjectDatabase.CalculateHistoryDivergence()
Fix #562
Diffstat (limited to 'LibGit2Sharp/ObjectDatabase.cs')
-rw-r--r--LibGit2Sharp/ObjectDatabase.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs
index 0385a4f7..a31681ea 100644
--- a/LibGit2Sharp/ObjectDatabase.cs
+++ b/LibGit2Sharp/ObjectDatabase.cs
@@ -235,5 +235,20 @@ namespace LibGit2Sharp
return repo.Lookup<TagAnnotation>(tagId);
}
+
+ /// <summary>
+ /// Returns the merge base (best common ancestor) of the given commits
+ /// and the distance between each of these commits and this base.
+ /// </summary>
+ /// <param name="one">The <see cref="Commit"/> being used as a reference.</param>
+ /// <param name="another">The <see cref="Commit"/> being compared against <paramref name="one"/>.</param>
+ /// <returns>A instance of <see cref="HistoryDivergence"/>.</returns>
+ public virtual HistoryDivergence CalculateHistoryDivergence(Commit one, Commit another)
+ {
+ Ensure.ArgumentNotNull(one, "one");
+ Ensure.ArgumentNotNull(another, "another");
+
+ return new HistoryDivergence(repo, one, another);
+ }
}
}