Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Aug 15, 2024
1 parent 128cb6b commit 01ff9d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions olah/proxy/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions olah/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01ff9d6

Please sign in to comment.