Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel83 authored and Manuel83 committed Oct 13, 2017
1 parent f07a2bd commit ad21625
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions gittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@
from git import Repo, Git

repo = Repo('./')
print repo
for remote in repo.remotes:
branch = repo.active_branch

print branch.name

for remote in repo.remotes:
remote.fetch()

url = 'https://api.github.com/repos/manuel83/craftbeerpi3/releases'
response = requests.get(url)

result = []

result = {"branches":[], "releases": []}

result["branches"].append({"name": "master"})

for branch in repo.branches:
result["branches"].append({"name": branch.name})

for r in response.json():
result.append({"tag_name": r.get("tag_name"), "timestamp": r.get("created_at")})
result["releases"].append({"name": "tags/%s" % r.get("tag_name")})

print result

print result

0 comments on commit ad21625

Please sign in to comment.