Skip to content

Commit

Permalink
Simplify logic to check default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadit Rahul Kamat authored Jan 13, 2021
1 parent 98641cd commit 8c778fb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,7 @@ def get_stats(github):
stats += render_image(text, url)
=======
stats += '**' + translate['Timeline'] + '**\n\n'
try:
github.get_repo(f'{username}/{username}').get_branch('main')
branch_name = 'main'
except GithubException:
branch_name = 'master'
branch_name = github.get_repo(f'{username}/{username}').default_branch
stats = stats + '![Chart not found](https://raw.githubusercontent.com/' + username + '/' + username + '/' + branch_name + '/charts/bar_graph.png) \n\n'
>>>>>>> 96f79dc (Detect main branch)

Expand Down

0 comments on commit 8c778fb

Please sign in to comment.