Merge pull request #790 from flatcar/dongsu/gh-fetch-remote

.github: check for remote branches with git ls-remote
This commit is contained in:
Dongsu Park 2023-05-08 17:13:57 +02:00 committed by GitHub
commit 3b3fbccc74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,8 +66,7 @@ function prepare_git_repo() {
function check_remote_branch() {
local target_branch="${1}"
if git -C "${SDK_OUTER_TOPDIR}" show-ref "remotes/origin/${target_branch}"; then
if git -C "${SDK_OUTER_TOPDIR}" ls-remote --refs --heads --exit-code origin "${target_branch}" >/dev/null; then
return 1
fi
return 0