From 26dbc99ece496396c96c66934c340eba6b44e4ff Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 18 2014 07:18:56 +0000 Subject: Fix browsing the fork of a fork (log, tree, file, branch...) --- diff --git a/progit/repo.py b/progit/repo.py index 4998848..c3af163 100644 --- a/progit/repo.py +++ b/progit/repo.py @@ -65,6 +65,9 @@ def view_repo(repo, username=None): if repo.is_fork: parentname = os.path.join( APP.config['GIT_FOLDER'], repo.parent.path) + if repo.parent.is_fork: + parentname = os.path.join( + APP.config['FORK_FOLDER'], repo.parent.path) orig_repo = pygit2.Repository(parentname) if not repo_obj.is_empty and not orig_repo.is_empty: @@ -127,6 +130,10 @@ def view_repo_branch(repo, branchname, username=None): if repo.is_fork: parentname = os.path.join( APP.config['GIT_FOLDER'], repo.parent.path) + if repo.parent.is_fork: + parentname = os.path.join( + APP.config['FORK_FOLDER'], repo.parent.path) + orig_repo = pygit2.Repository(parentname) if not repo_obj.is_empty and not orig_repo.is_empty: @@ -206,6 +213,10 @@ def view_log(repo, branchname=None, username=None): if repo.is_fork: parentname = os.path.join( APP.config['GIT_FOLDER'], repo.parent.path) + if repo.parent.is_fork: + parentname = os.path.join( + APP.config['FORK_FOLDER'], repo.parent.path) + orig_repo = pygit2.Repository(parentname) if not repo_obj.is_empty and not orig_repo.is_empty: orig_commit = orig_repo[orig_repo.head.target]