You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/NerdBank.GitVersioning/GitExtensions.cs
+27-20Lines changed: 27 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,18 @@ public static class GitExtensions
33
33
/// </summary>
34
34
/// <param name="commit">The commit to measure the height of.</param>
35
35
/// <param name="repoRelativeProjectDirectory">The repo-relative project directory for which to calculate the version.</param>
36
+
/// <param name="baseVersion">Optional base version to calculate the height. If not specified, the base version will be calculated by scanning the repository.</param>
36
37
/// <returns>The height of the commit. Always a positive integer.</returns>
Requires.Argument(repoRelativeProjectDirectory==null||!Path.IsPathRooted(repoRelativeProjectDirectory),nameof(repoRelativeProjectDirectory),"Path should be relative to repo root.");
@@ -170,7 +175,7 @@ public static Commit GetCommitFromTruncatedIdInteger(this Repository repo, int t
170
175
/// <param name="commit">The commit whose ID and position in history is to be encoded.</param>
171
176
/// <param name="repoRelativeProjectDirectory">The repo-relative project directory for which to calculate the version.</param>
172
177
/// <param name="versionHeight">
173
-
/// The version height, previously calculated by a call to <see cref="GetVersionHeight(Commit, string)"/>
178
+
/// The version height, previously calculated by a call to <see cref="GetVersionHeight(Commit, string, Version)"/>
174
179
/// with the same value for <paramref name="repoRelativeProjectDirectory"/>.
175
180
/// </param>
176
181
/// <returns>
@@ -188,7 +193,13 @@ public static Version GetIdAsVersion(this Commit commit, string repoRelativeProj
188
193
Requires.Argument(repoRelativeProjectDirectory==null||!Path.IsPathRooted(repoRelativeProjectDirectory),nameof(repoRelativeProjectDirectory),"Path should be relative to repo root.");
@@ -367,7 +384,7 @@ public static string FindLibGit2NativeBinaries(string basePath)
367
384
/// <param name="expectedVersion">The version to test for in the commit</param>
368
385
/// <param name="repoRelativeProjectDirectory">The repo-relative directory from which <paramref name="expectedVersion"/> was originally calculated.</param>
369
386
/// <returns><c>true</c> if the <paramref name="commit"/> matches the major and minor components of <paramref name="expectedVersion"/>.</returns>
/// <param name="commit">The commit whose ID and position in history is to be encoded.</param>
496
513
/// <param name="versionOptions">The version options applicable at this point (either from commit or working copy).</param>
497
-
/// <param name="repoRelativeProjectDirectory">The repo-relative project directory for which to calculate the version.</param>
498
-
/// <param name="versionHeight">
499
-
/// The version height, previously calculated by a call to <see cref="GetVersionHeight(Commit, string)"/>
500
-
/// with the same value for <paramref name="repoRelativeProjectDirectory"/>.
501
-
/// </param>
514
+
/// <param name="versionHeight">The version height, previously calculated by a call to <see cref="GetVersionHeight(Commit, string, Version)"/>.</param>
502
515
/// <returns>
503
516
/// A version whose <see cref="Version.Build"/> and
504
517
/// <see cref="Version.Revision"/> components are calculated based on the commit.
Verify.Operation(adjustedVersionHeight<=MaximumBuildNumberOrRevisionComponent,"Git height is {0}, which is greater than the maximum allowed {0}.",adjustedVersionHeight,MaximumBuildNumberOrRevisionComponent);
0 commit comments