From c03453ea486b3811439a319ecbf87d0b342bd12e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 25 2016 12:02:05 +0000 Subject: Fix typos and code style pointed out by @vivekanand1101 --- diff --git a/pagure/internal/__init__.py b/pagure/internal/__init__.py index 7146628..dfb5b54 100644 --- a/pagure/internal/__init__.py +++ b/pagure/internal/__init__.py @@ -441,9 +441,9 @@ def get_branches_of_commit(): response.status_code = 404 return response - reponame = os.path.join(pagure.APP.config['GIT_FOLDER'], repo.path) + repopath = os.path.join(pagure.APP.config['GIT_FOLDER'], repo.path) - if not os.path.exists(reponame): + if not os.path.exists(repopath): response = flask.jsonify({ 'code': 'ERROR', 'message': 'No git repo found with the information provided', @@ -451,7 +451,7 @@ def get_branches_of_commit(): response.status_code = 404 return response - repo_obj = pygit2.Repository(reponame) + repo_obj = pygit2.Repository(repopath) try: commit_id in repo_obj @@ -473,11 +473,8 @@ def get_branches_of_commit(): for branchname in repo_obj.listall_branches(): branch = repo_obj.lookup_branch(branchname) - diff_commits = [] - if not repo_obj.is_empty and repo_obj.listall_branches() > 1: - merge_commit = None if compare_branch: