| Total Complexity | 2 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from lib.action import TravisCI |
||
| 4 | class ListBranchesAction(TravisCI): |
||
| 5 | def run(self, repo_id): |
||
| 6 | """ |
||
| 7 | Listing branches for a give Repository |
||
| 8 | """ |
||
| 9 | path = '/repos/' + str(repo_id) + '/branches' |
||
| 10 | response = self._perform_request(path, method="GET") |
||
| 11 | data = response.json() |
||
| 12 | branches = [] |
||
| 13 | for arg in data['commits']: |
||
| 14 | branches.append(arg['branch']) |
||
| 15 | return branches |
||
| 16 |