diff --git a/olah/proxy/tree.py b/olah/proxy/tree.py index b0125a5..875930d 100644 --- a/olah/proxy/tree.py +++ b/olah/proxy/tree.py @@ -40,9 +40,7 @@ async def tree_proxy_cache( ): # save repos_path = app.app_settings.repos_path - save_dir = os.path.join( - repos_path, f"api/{repo_type}/{org}/{repo}/tree/{commit}" - ) + save_dir = os.path.join(repos_path, f"api/{repo_type}/{org}/{repo}/tree/{commit}") save_path = os.path.join(save_dir, "tree.json") make_dirs(save_path) @@ -116,9 +114,7 @@ async def tree_generator( # save repos_path = app.app_settings.repos_path - save_dir = os.path.join( - repos_path, f"api/{repo_type}/{org}/{repo}/tree/{commit}" - ) + save_dir = os.path.join(repos_path, f"api/{repo_type}/{org}/{repo}/tree/{commit}") save_path = os.path.join(save_dir, "tree.json") make_dirs(save_path) diff --git a/olah/server.py b/olah/server.py index 9a127c6..20ba9f9 100644 --- a/olah/server.py +++ b/olah/server.py @@ -230,10 +230,10 @@ async def tree_proxy_common(repo_type: str, org: str, repo: str, commit: str, re git_path = os.path.join(mirror_path, repo_type, org, repo) if os.path.exists(git_path): local_repo = LocalMirrorRepo(git_path, repo_type, org, repo) - meta_data = local_repo.get_tree(commit) - if meta_data is None: + tree_data = local_repo.get_tree(commit) + if tree_data is None: continue - return JSONResponse(content=meta_data) + return JSONResponse(content=tree_data) except git.exc.InvalidGitRepositoryError: logger.warning(f"Local repository {git_path} is not a valid git reposity.") continue