A class that stores a tree of a commit
Inheritance: Object
コード例 #1
0
 public SymlinkTreeEntry(Tree myParent, SHA1 objId, string objName, bool exec)
     : base(myParent, objId, objName)
 {
     mode = GitFileMode.Symlink;
 }
コード例 #2
0
ファイル: BlobTreeEntry.cs プロジェクト: igorgue/git-sharp
 public BlobTreeEntry(Tree myParent, SHA1 objId, string objName, bool exec)
     : base(myParent, objId, objName)
 {
     SetExecutable (exec);
 }
コード例 #3
0
ファイル: ObjectStore.cs プロジェクト: GunioRobot/git-sharp
 private void LsTree(Tree tree)
 {
     Console.Write (tree);
 }
コード例 #4
0
ファイル: ObjectStore.cs プロジェクト: GunioRobot/git-sharp
        /// <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 ();
            }
        }
コード例 #5
0
ファイル: Index.cs プロジェクト: igorgue/git-sharp
        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);
            }
        }
コード例 #6
0
ファイル: Index.cs プロジェクト: igorgue/git-sharp
 public void ReadTree(Tree tree, Repo repo)
 {
     ReadTree ("", tree, repo);
 }