Fix path handling when there are no repositories
parent
da5d6fd8c5
commit
05b963d611
|
@ -2318,6 +2318,10 @@ def git_list_repositories():
|
|||
return jsonify({"error": "Repository storage not found, git functionality may not be installed."}), 500
|
||||
|
||||
repos = []
|
||||
if os.path.exists(os.path.join(REPOSITORIES_BASE_PATH, OGGIT_USER)):
|
||||
# If the base path exists, but the OGGIT_USER subpath doesn't, it means we've got an empty
|
||||
# install. OgGit is present, but there's no repos yet.
|
||||
|
||||
for entry in os.scandir(os.path.join(REPOSITORIES_BASE_PATH, OGGIT_USER)):
|
||||
if entry.is_dir(follow_symlinks=False) and os.path.isfile(os.path.join(entry.path, "HEAD")):
|
||||
name = entry.name
|
||||
|
|
Loading…
Reference in New Issue