From f61c246f1d97156a4072d60182032be8b32ea7eb Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 2 Nov 2020 15:21:49 +0100 Subject: [PATCH] Check that master branch does indeed exists or fallback to stable --- package_check.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package_check.sh b/package_check.sh index 8661876..720dfaf 100755 --- a/package_check.sh +++ b/package_check.sh @@ -517,7 +517,18 @@ then # Force the branch master if no branch is specified. if [ -z "$gitbranch" ] then - gitbranch="-b master" + if git ls-remote --quiet --exit-code $app_arg master + then + gitbranch="-b master" + else + if git ls-remote --quiet --exit-code $app_arg stable + then + gitbranch="-b stable" + else + ECHO_FORMAT "Unable to find a default branch to test (master or stable)" "red" + clean_exit 1 + fi + fi fi # Clone the repository git clone $app_arg $gitbranch "$package_path"