diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 4533bdc..7b678f8 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -31,10 +31,17 @@ def _get_parent_repo_path(repo): """ Return the path of the parent git repository corresponding to the provided Repository object from the DB. """ + + if repo.is_fork: + parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.parent.path) + if repo.parent.is_fork: + parentpath = os.path.join(APP.config['FORK_FOLDER'], repo.parent.path) + if repo.parent: parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.parent.path) else: parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.path) + return parentpath