diff --git a/progit/app.py b/progit/app.py index da524c2..a3aeb96 100644 --- a/progit/app.py +++ b/progit/app.py @@ -344,10 +344,13 @@ def view_file(repo, identifier, filename): def view_commit(repo, commitid): """ Render a commit in a repo """ - 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)) try: commit = repo_obj.get(commitid) diff --git a/progit/templates/commit.html b/progit/templates/commit.html index 970123e..bdfbe54 100644 --- a/progit/templates/commit.html +++ b/progit/templates/commit.html @@ -1,6 +1,6 @@ {% extends "master.html" %} -{% block title %}{{ repo }} - {{ commitid }}{% endblock %} +{% block title %}{{ repo.name }} - {{ commitid }}{% endblock %} {%block tag %}home{% endblock %} @@ -8,20 +8,20 @@