Merge pull request #84 from YunoHost/check-master-exists

Check that master branch does indeed exists or fallback to stable
This commit is contained in:
Alexandre Aubin 2020-11-06 01:06:09 +01:00 committed by GitHub
commit 2d283066e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -513,8 +513,19 @@ if echo "$app_arg" | grep -Eq "https?:\/\/"
then then
# Force the branch master if no branch is specified. # Force the branch master if no branch is specified.
if [ -z "$gitbranch" ] if [ -z "$gitbranch" ]
then
if git ls-remote --quiet --exit-code $app_arg master
then then
gitbranch="-b master" 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 fi
# Clone the repository # Clone the repository
git clone $app_arg $gitbranch "$package_path" git clone $app_arg $gitbranch "$package_path"