private async Task <IEnumerable <string> > GetBitbucketBranchesAsync(Repository selectedRepo) { lock (_branches) { if (_branches.ContainsKey(selectedRepo)) { return(_branches[selectedRepo]); } } var list = new List <string>(); var getBranches = new GetBranchesRequest(selectedRepo, _settings); var result = await getBranches.SendAsync().ConfigureAwait(false); if (result.Success) { foreach (var value in result.Result["values"]) { list.Add(value["displayId"].ToString()); } } lock (_branches) { _branches.Add(selectedRepo, list); } return(list); }
private IEnumerable <string> GetBitbucketBranches(Repository selectedRepo) { if (Branches.ContainsKey(selectedRepo)) { return(Branches[selectedRepo]); } var list = new List <string>(); var getBranches = new GetBranchesRequest(selectedRepo, _settings); var result = getBranches.Send(); if (result.Success) { foreach (var value in result.Result["values"]) { list.Add(value["displayId"].ToString()); } } Branches.Add(selectedRepo, list); return(list); }