public SymlinkTreeEntry(Tree myParent, SHA1 objId, string objName, bool exec) : base(myParent, objId, objName) { mode = GitFileMode.Symlink; }
public BlobTreeEntry(Tree myParent, SHA1 objId, string objName, bool exec) : base(myParent, objId, objName) { SetExecutable (exec); }
private void LsTree(Tree tree) { Console.Write (tree); }
/// <summary> /// Get a tree and create the structure from there /// </summary> /// <param name="gitDir"> /// A <see cref="System.String"/> /// </param> /// <param name="tree"> /// A <see cref="Tree"/> /// </param> public void Checkout(string baseDir, Tree tree) { for (int i = 0; i < tree.Entries.Length; i++) { string fullPath = baseDir + "/" + tree.Entries[i].Name; Console.WriteLine ("Entry: #{0} {1} {2}", i, tree.Entries[i].Name, tree.Entries[i].Id.ToHexString ()); if (tree.Entries[i].IsTree ()) { if (!Directory.Exists (fullPath)) Directory.CreateDirectory (fullPath); Checkout (fullPath, (Tree) Get (tree.Entries[i].Id)); continue; } FileStream fs = new FileStream (fullPath, FileMode.Create, FileAccess.Write); Blob blobToWrite = (Blob) Get (tree.Entries[i].Id); fs.Write (blobToWrite.Data, 0, blobToWrite.Data.Length); // TODO: Set FileAttributes //File.SetAttributes ("", FileAttributes. fs.Close (); } }
public void ReadTree(string prefix, Tree tree, Repo repo) { TreeEntry[] treeEntries = tree.Entries; foreach (TreeEntry te in treeEntries) { string name; if (!String.IsNullOrEmpty (prefix)) name = String.Format ("{0}/{1}", prefix, te.Name); else name = te.Name; // if (te.IsTree (repo)) // ReadTree (name, tree, repo); } }
public void ReadTree(Tree tree, Repo repo) { ReadTree ("", tree, repo); }