Skip to content

Commit 6392cd9

Browse files
committed
minor changes based on review
1 parent 91148d8 commit 6392cd9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/GitVersionCore.Tests/Extensions/GitToolsTestingExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class GitToolsTestingExtensions
2727
public static ICommit CreateMockCommit()
2828
{
2929
var objectId = Substitute.For<IObjectId>();
30-
objectId.Sha.Returns(Guid.NewGuid().ToString().Replace("-", "") + "00000000");
30+
objectId.Sha.Returns(Guid.NewGuid().ToString("n") + "00000000");
3131

3232
var commit = Substitute.For<ICommit>();
3333
commit.Id.Returns(objectId);

src/GitVersionCore/Git/ReferenceName.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ReferenceName : IEquatable<ReferenceName>, IComparable<ReferenceNam
1414

1515
public ReferenceName(string canonical)
1616
{
17-
Canonical = canonical;
17+
Canonical = canonical ?? throw new ArgumentNullException(nameof(canonical));
1818
Friendly = Shorten();
1919
WithoutRemote = RemoveRemote();
2020
}

src/GitVersionCore/VersionCalculation/NextVersionCalculator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public NextVersionCalculator(ILog log, IBaseVersionCalculator baseVersionCalcula
2929

3030
public SemanticVersion FindVersion()
3131
{
32-
log.Info($"Running against branch: {context.CurrentBranch} ({(context.CurrentCommit != null ? context.CurrentCommit.ToString() : "-")})");
32+
log.Info($"Running against branch: {context.CurrentBranch} ({context.CurrentCommit?.ToString() ?? "-"})");
3333
if (context.IsCurrentCommitTagged)
3434
{
3535
log.Info($"Current commit is tagged with version {context.CurrentCommitTaggedVersion}, " +

0 commit comments

Comments
 (0)