From bdddc15e05dffb68d0d9202963f5c251f6fb8f9a Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Mar 19 2014 10:24:16 +0000 Subject: View a branch from the DB repo --- diff --git a/progit/app.py b/progit/app.py index d1a9b53..6e62479 100644 --- a/progit/app.py +++ b/progit/app.py @@ -191,10 +191,14 @@ def view_repo(repo): def view_repo_branch(repo, branchname): """ Displays the information about a specific branch. """ - reponame = os.path.join(APP.config['GIT_FOLDER'], repo) - if not os.path.exists(reponame): + repo = progit.lib.get_project(SESSION, repo) + + if repo is None: flask.abort(404) - repo_obj = pygit2.Repository(reponame) + + repo_obj = pygit2.Repository(os.path.join(APP.config["GIT_FOLDER"], + repo.path)) + if not branchname in repo_obj.listall_branches(): flask.abort(404)