Files
ml-sdk/script/actions_utils/check_branch_not_remote.sh
zeekay bde2e2531b Initial commit: Lux FHE ML SDK
Machine Learning with FHE - fork of Zama Concrete-ML
- Built-in FHE-friendly ML models
- scikit-learn compatible API
- PyTorch model conversion
- Quantization-aware training
2025-12-27 21:08:09 -08:00

40 lines
816 B
Bash
Executable File

#!/usr/bin/env bash
# Check if the given branch name does not refer to an existing remote branch (from origin). If it
# does, a 1 exit code is returned
set -e
BRANCH_NAME=""
while [ -n "$1" ]
do
case "$1" in
"--branch_name" )
shift
BRANCH_NAME="$1"
;;
*)
echo "Unknown param : $1"
exit 1
;;
esac
shift
done
# Check that a tag name is provided
if [ "$BRANCH_NAME" == "" ]; then
echo "Please provide a branch name with option '--branch_name'"
exit 1
fi
# Fetch all remote branches
git fetch --all
# If the branch name is already found remotely, exist with status 1
if [ -n "$(git ls-remote --heads origin "${BRANCH_NAME}")" ]; then
echo "Branch ${BRANCH_NAME} already exists remotely."
exit 1
fi