| |
@@ -127,18 +127,23 @@
|
| |
|
| |
# Get a list of the original English repos
|
| |
repos = []
|
| |
+ default_branch = site_yml["content"].get("branches", ["master"])
|
| |
+ if type(default_branch) is str:
|
| |
+ default_branch = [default_branch]
|
| |
+
|
| |
for repo_data in site_yml["content"]["sources"]:
|
| |
|
| |
- if "branches" not in repo_data:
|
| |
- repo_data["branches"] = ["master"]
|
| |
- if "start_path" not in repo_data:
|
| |
- repo_data["start_path"] = ""
|
| |
+ branches = repo_data.get("branches", default_branch)
|
| |
+ if type(branches) is str:
|
| |
+ branches = [branches]
|
| |
+
|
| |
+ start_path = repo_data.get("start_path", "")
|
| |
|
| |
- for branch in repo_data["branches"]:
|
| |
+ for branch in branches:
|
| |
repo = {}
|
| |
repo["url"] = repo_data["url"]
|
| |
repo["branch"] = branch
|
| |
- repo["start_path"] = repo_data["start_path"]
|
| |
+ repo["start_path"] = start_path
|
| |
|
| |
repos.append(repo)
|
| |
|
| |
Use default branch defined in "content" => this prepare future migration to "main" as a default, and "master" as an exception
Detect cases when branch is a string instead of a list (which is currently used to say: the default branch for this repository is "main")