From 5ae6f86a1f2eeecb7564372e0936fb4d294e3c96 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 12 Feb 2020 19:36:52 +0100 Subject: [PATCH] pmb.helpers.git.get_branches_official(): new func (!1882) Add dummy function that only returns ["master"] for now, so we can use it in the upcoming git checks for "pmbootstrap status". More sophisticated logic to figure out the branches will be added soon, see project direction 2020 issue. Related: #1829 --- pmb/helpers/git.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pmb/helpers/git.py b/pmb/helpers/git.py index cb456a32..f2af4192 100644 --- a/pmb/helpers/git.py +++ b/pmb/helpers/git.py @@ -96,6 +96,14 @@ def get_upstream_remote(args, name_repo): " repository: {}".format(name_repo, url, path)) +def get_branches_official(args, name_repo): + """ Get all branches that point to official release channels. + :returns: list of supported branches, e.g. ["master", "3.11"] """ + # More sophisticated logic to figure out the branches will be added soon: + # https://gitlab.com/postmarketOS/postmarketos/issues/11 + return ["master"] + + def pull(args, name_repo): """ Check if on official branch and essentially try 'git pull --ff-only'. Instead of really doing 'git pull --ff-only', do it in multiple steps @@ -103,7 +111,7 @@ def pull(args, name_repo): on which part fails. :returns: integer, >= 0 on success, < 0 on error """ - branches_official = ["master"] + branches_official = get_branches_official(args, name_repo) # Skip if repo wasn't cloned path = get_path(args, name_repo)