Skip to content

Commit bb294be

Browse files
committed
Allow branch override
Since eb4d112 when commit and branch are specified, kas checks if the commit is actually contained in the branch. This makes it impossible to have a branch set for a repo but use a commit override to build a merge request on this repo (obviously not yet on the specified branch). This change allows the branch property of repos to be overridden to a specific value, or even to Null. Signed-off-by: Nicolas Labriet <[email protected]>
1 parent 7ecc070 commit bb294be

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

kas/repos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def factory(name, repo_config, repo_defaults, repo_fallback_path,
273273
'for local repositories.')
274274
if refspec is None:
275275
commit = repo_overrides.get('commit', commit)
276+
branch = repo_overrides.get('branch', branch)
276277
if commit and get_context().update:
277278
logging.warning(f'Update of "{name}" requested, but repo is '
278279
'pinned to a fixed commit. Not updating.')

kas/schema-kas.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
"type": "object",
119119
"additionalProperties": false,
120120
"properties": {
121+
"branch": {
122+
"description": "Branch in which to find the overridden commit, can be Null",
123+
"type": ["string", "null"]
124+
},
121125
"commit": {
122126
"type": "string"
123127
}

0 commit comments

Comments
 (0)