예제 #1
0
        private void AddFileTreeToRepo(string githubUserId, Repository repo)
        {
            var treeJsonFromInquisitor = _inquisitor.GetRecursiveTree(githubUserId, repo.Name, repo.Sha);

            if (!string.IsNullOrEmpty(treeJsonFromInquisitor))
            {
                var treeJson = JObject.Parse(treeJsonFromInquisitor);
                if (treeJson.Property("tree") != null)
                {
                    var jsonArray = JArray.Parse(treeJson["tree"].ToString());
                    for (var index = 0; index < jsonArray.Count; index++)
                    {
                        repo.Files.Add(jsonArray[index].KeyToString("path"));
                    }
                }
            }
        }