Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/SIL.Harmony.Core/CommitBase.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.IO.Hashing;
using System.Text.Json.Serialization;

Expand All @@ -11,6 +12,7 @@ public abstract class CommitBase : IComparable<CommitBase>
{
public const string NullParentHash = "0000";
[JsonConstructor]
[SetsRequiredMembers]
protected internal CommitBase(Guid id, HybridDateTime hybridDateTime)
{
Id = id;
Expand Down Expand Up @@ -56,6 +58,7 @@ public int CompareTo(CommitBase? other)
/// <inheritdoc cref="CommitBase"/>
public abstract class CommitBase<TChange> : CommitBase
{
[SetsRequiredMembers]
internal CommitBase(Guid id, HybridDateTime hybridDateTime) : base(id, hybridDateTime)
{
}
Expand Down
7 changes: 7 additions & 0 deletions src/SIL.Harmony.Core/ServerCommit.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
Expand All @@ -7,6 +8,7 @@ namespace SIL.Harmony.Core;
public class ServerCommit : CommitBase<ServerJsonChange>
{
[JsonConstructor]
[SetsRequiredMembers]
protected ServerCommit(Guid id, HybridDateTime hybridDateTime) : base(id,
hybridDateTime)
{
Expand All @@ -16,6 +18,11 @@ public ServerCommit(Guid id) : base(id)
{
}

//only here for a downstream gql issue
private ServerCommit() : base(Guid.NewGuid())
{
}

public Guid ProjectId { get; set; }
}

Expand Down
2 changes: 2 additions & 0 deletions src/SIL.Harmony/Commit.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using SIL.Harmony.Changes;
using SIL.Harmony.Db;
Expand All @@ -7,6 +8,7 @@ namespace SIL.Harmony;
public class Commit : CommitBase<IChange>
{
[JsonConstructor]
[SetsRequiredMembers]
protected Commit(Guid id, string hash, string parentHash, HybridDateTime hybridDateTime) : base(id,
hybridDateTime)
{
Expand Down
Loading