Abacn commented on code in PR #23703:
URL: https://github.com/apache/beam/pull/23703#discussion_r998745076
##########
scripts/ci/ci_check_git_branch.sh:
##########
@@ -16,18 +16,22 @@
# specific language governing permissions and limitations
# under the License.
-function is_branch() {
- #if nothing matches show-ref will return an error code of 1
- if git show-ref --quiet --verify -- "refs/heads/$1" ; then
- return 1
+function is_in_remote() {
+ local branch=${1}
+ local existed_in_remote=$(git ls-remote --heads origin ${branch})
+
+ if [[ -z ${existed_in_remote} ]]; then
+ return 0
else
- return 0
+ return 1
fi
}
-if is_branch "$1"; then
+if is_in_remote "$1"; then
Review Comment:
In bash true is 0 and false is non-zero. Is this logic intended?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]