GitCommands.GitCommands.GetTree C# (CSharp) Method

GetTree() public static method

public static GetTree ( string id ) : List
id string
return List
        public static List<IGitItem> GetTree(string id)
        {
            var tree = RunCachableCmd(Settings.GitCommand, "ls-tree -z \"" + id + "\"");

            var itemsStrings = tree.Split(new char[] { '\0', '\n' });

            var items = new List<IGitItem>();

            foreach (var itemsString in itemsStrings)
            {
                if (itemsString.Length <= 53)
                    continue;

                var item = new GitItem { Mode = itemsString.Substring(0, 6) };
                var guidStart = itemsString.IndexOf(' ', 7);
                item.ItemType = itemsString.Substring(7, guidStart - 7);
                item.Guid = itemsString.Substring(guidStart + 1, 40);
                item.Name = itemsString.Substring(guidStart + 42).Trim();
                item.FileName = item.Name;

                items.Add(item);
            }

            return items;
        }

Same methods

GitCommands::GetTree ( bool tags, bool branches ) : string
GitCommands