private static byte[] Entry(FileMode mode, string name, AnyObjectId id)
		{
			var @out = new MemoryStream();
			mode.CopyTo(@out);
			@out.WriteByte((byte) ' ');
			byte[] bytes = Constants.encode(name);
			@out.Write(bytes, 0, bytes.Length);
			@out.WriteByte(0);
			id.copyRawTo(@out);
			return @out.ToArray();
		}
Exemple #2
0
 private DirCacheEntry MakeEntry(string path, FileMode mode, String content)
 {
     var ent = new DirCacheEntry(path);
     ent.setFileMode(mode);
     byte[] contentBytes = Constants.encode(content);
     ent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(contentBytes.Length, new MemoryStream(contentBytes)));
     return ent;
 }
Exemple #3
0
 private DirCacheEntry MakeEntry(string path, FileMode mode)
 {
     return MakeEntry(path, mode, path);
 }
 private static void assertModes(string path, FileMode mode0, GitSharp.Core.TreeWalk.TreeWalk tw)
 {
     Assert.IsTrue(tw.next(), "has " + path);
     Assert.AreEqual(path, tw.getPathString());
     Assert.AreEqual(mode0, tw.getFileMode(0));
 }
		private DirCacheEntry makeEntry(string path, FileMode mode)
		{
			byte[] pathBytes = Constants.encode(path);
			DirCacheEntry ent = new DirCacheEntry(path);
			ent.setFileMode(mode);
			ent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(pathBytes.Length, new MemoryStream(pathBytes)));
			return ent;
		}