Skip to content
Snippets Groups Projects
Commit 06aec8a0 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

pkg-merge-upstream-to-downstreams: Fix targeting stable branches


When targeting development/preview releases the script to merge changes
from upstream works fine, but when aiming at stable releases the part
that tries to detect which branch to target (`-security` vs. `-updates`)
fails to find the refs it looks for because it searches the local refs
instead of the remote ones.

Point it to the refs under the `origin` remote to make it happy.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 03a0f91f
No related branches found
No related tags found
2 merge requests!136pkg-merge-upstream-to-downstreams: Fix targeting stable branches,!93WIP: documentation-builder: Rebase on Apertis instead of Debian Buster
Pipeline #163986 passed
......@@ -17,10 +17,10 @@ def parse_ref(ref: str) -> str:
return git('rev-parse', '-q', '--verify', ref + '^{commit}', _ok_code=[0, 1]).strip('\n')
def ensure_branch(name: str, fallbacks: list) -> str:
if parse_ref(name):
if parse_ref(f'origin/{name}'):
return name
for b in fallbacks:
commit = parse_ref(b)
commit = parse_ref(f'origin/{b}')
if commit:
print(f'Setting branch {name} to point to {b} ({commit:.7})')
git('update-ref', f'refs/heads/{name}', commit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment