public void test024_createCommitNonAscii() { ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]); Tree almostEmptyTree = new Tree(db); almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Encoding.ASCII.GetBytes("empty"), false)); ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree); Commit commit = new Commit(db); commit.TreeId = (almostEmptyTreeId); commit.Author = (new PersonIdent("Joe H\u00e4cker", "*****@*****.**", 4294967295L, 60)); commit.Committer = (new PersonIdent("Joe Hacker", "*****@*****.**", 4294967295L, 60)); commit.setEncoding("ISO-8859-1"); commit.Message = "\u00dcbergeeks"; ObjectId cid = new ObjectWriter(db).WriteCommit(commit); var s = new Inspector(db).Inspect(cid); Assert.AreEqual("2979b39d385014b33287054b87f77bcb3ecb5ebf", cid.ToString()); }
public void test023_createCommitNonAnullii() { ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]); Tree almostEmptyTree = new Tree(db); almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, Encoding.ASCII.GetBytes("empty"), false)); ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree); Commit commit = new Commit(db); commit.TreeId = (almostEmptyTreeId); commit.Author = (new PersonIdent("Joe H\u00e4cker", "*****@*****.**", 4294967295L, 60)); commit.Committer = (new PersonIdent("Joe Hacker", "*****@*****.**", 4294967295L, 60)); commit.setEncoding("UTF-8"); commit.Message = ("\u00dcbergeeks"); ObjectId cid = new ObjectWriter(db).WriteCommit(commit); Assert.AreEqual("4680908112778718f37e686cbebcc912730b3154", cid.ToString()); }