Skip to content

Commit 62c5816

Browse files
committed
[update-checkout] When branch is not set, use the default-branch-alias specified by our config file.
Certain checkout configurations do not have the proper default branches set. We delegate to the config file to specify the default branches to use so the config file can just tell us the appropriate thing to do here.
1 parent b0862e2 commit 62c5816

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

utils/update-checkout

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
153153
config = json.load(f)
154154
validate_config(config)
155155

156+
# If branch is None, default to using the default branch alias specified by
157+
# our configuration file.
158+
if branch is None:
159+
branch = config['default-branch-alias']
160+
156161
if clone or clone_with_ssh:
157162
obtain_additional_swift_sources(
158163
config, clone_with_ssh, branch, skip_history, args.skip_repository)

utils/update-checkout-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"swift-integration-tests": "apple/swift-integration-tests"
1717
},
1818
"branch_names": ["master-branches", "next-branches", "swift-3.0-preview-1-branches"],
19+
"default-branch-alias": "master",
1920
"master-branches": {
2021
"aliases": ["master", "stable"],
2122
"repos": {

0 commit comments

Comments
 (0)