public void ComputeInitialCommitHash() { var signature = new Signature( "Eric Damtoft", "*****@*****.**", DateTimeOffset.FromUnixTimeSeconds(1573304272).ToOffset(TimeSpan.FromHours(-5))); var commit = new Commit( Hash.FromHex("4b825dc642cb6eb9a060e54bf8d69288fbee4904"), new Hash[0], signature, signature, "initial commit"); var hash = commit.GetGitHash(); Assert.AreEqual("08e57b124c3fb7347b5cb7f31b44053eee414f1d", hash.ToString()); }
public void CommitWithParent() { var author = new Signature( "Eric Damtoft", "*****@*****.**", DateTimeOffset.FromUnixTimeSeconds(1573308076).ToOffset(TimeSpan.FromHours(-5))); var committer = new Signature( "Eric Damtoft", "*****@*****.**", DateTimeOffset.FromUnixTimeSeconds(1573317570).ToOffset(TimeSpan.FromHours(-5))); var commit = new Commit( Hash.FromHex("d04b476e5c85567cc72603fa0386d89b89dfe8ba"), new Hash[] { Hash.FromHex("08e57b124c3fb7347b5cb7f31b44053eee414f1d") }, author, committer, "Add Sample Files"); var hash = commit.GetGitHash(); Assert.AreEqual("78b4e971f5602d603a4e235944fff4d9585d9894", hash.ToString()); }