From f395ef231bbc3fd61821ba7ba36b1246346a909f Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Thu, 22 Sep 2022 05:14:47 +0200 Subject: [PATCH] packages: clone_pkgbuilds(): use `git remote update` before `git switch` --- packages/pkgbuild.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/pkgbuild.py b/packages/pkgbuild.py index 17dbb3e..c3c5469 100644 --- a/packages/pkgbuild.py +++ b/packages/pkgbuild.py @@ -33,9 +33,12 @@ def clone_pkgbuilds(pkgbuilds_dir: str, repo_url: str, branch: str, interactive= if current_branch != branch: logging.warning(f'pkgbuilds repository is on the wrong branch: {current_branch}, requested: {branch}') if interactive and click.confirm('Would you like to switch branches?', default=False): + result = git(['remote', 'update'], dir=pkgbuilds_dir) + if result.returncode != 0: + raise Exception('failed updating PKGBUILDs branches') result = git(['switch', branch], dir=pkgbuilds_dir) if result.returncode != 0: - raise Exception('failed switching branches') + raise Exception('failed switching PKGBUILDs branches') if update: if interactive: if not click.confirm('Would you like to try updating the PKGBUILDs repo?'):