diff --git a/progit/app.py b/progit/app.py index a3aeb96..f897c9b 100644 --- a/progit/app.py +++ b/progit/app.py @@ -280,10 +280,13 @@ def view_log(repo, branchname=None): def view_file(repo, identifier, filename): """ Displays the content of a file or a tree for the specified 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)) if identifier in repo_obj.listall_branches(): branchname = identifier diff --git a/progit/templates/file.html b/progit/templates/file.html index 15c2466..d149b63 100644 --- a/progit/templates/file.html +++ b/progit/templates/file.html @@ -8,19 +8,19 @@